build<T> method
Step<T>
build<T>(
- FutureOr<
T> runStep(- A valueA,
- B valueB,
- C valueC,
- D valueD,
- E valueE,
- F valueF,
- G valueG,
- H valueH,
Build a step with a single dependency.
This methods requires a runStep
function which runs the step, given
values from evaluation of dependent steps. The runStep
method may be
asynchronous. The runStep
method will be invoked by Runner.run
when
the step is evaluated.
The dependent steps which creates valueA
, valueB
, ..., passed to
runStep
have already be defined when this object was created.
See Step.define for how to define steps using this API.
This method returns the Step built by the builder.
Implementation
Step<T> build<T>(
FutureOr<T> Function(
A valueA,
B valueB,
C valueC,
D valueD,
E valueE,
F valueF,
G valueG,
H valueH,
)
runStep,
) {
return Step._(_name, (r, wrap) async {
final a_ = r.run(_a);
final b_ = r.run(_b);
final c_ = r.run(_c);
final d_ = r.run(_d);
final e_ = r.run(_e);
final f_ = r.run(_f);
final g_ = r.run(_g);
final h_ = r.run(_h);
await Future.wait([a_, b_, c_, d_, e_, f_, g_, h_]);
final a = await a_;
final b = await b_;
final c = await c_;
final d = await d_;
final e = await e_;
final f = await f_;
final g = await g_;
final h = await h_;
return await wrap(() => runStep(a, b, c, d, e, f, g, h));
}, [_a, _b, _c, _d, _e, _f, _g, _h]);
}