build<T> method

Step<T> build<T>(
  1. FutureOr<T> runStep(
    1. A valueA,
    2. B valueB,
    3. C valueC,
    4. D valueD,
    5. E valueE,
    6. F valueF,
    7. G valueG,
    )
)

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,
  )
      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);
    await Future.wait([a_, b_, c_, d_, e_, f_, g_]);
    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_;
    return await wrap(() => runStep(a, b, c, d, e, f, g));
  }, [_a, _b, _c, _d, _e, _f, _g]);
}