effectResolved method

  1. @override
void effectResolved(
  1. int effectId,
  2. dynamic result
)
override

Defines function type which is invoked when an effect is successfully resolved by the middleware

effectId The ID of the yielded effect result The result of the successful resolution of the effect. In case of Fork or Spawn effects, the result will be a Task object.

Implementation

@override
void effectResolved(int effectId, dynamic result) {
  var ed = _effectsById[effectId];
  ed?.end = DateTime.now();
  var duration = ed?.end?.difference(ed.start);
  ed?.result = result;
  ed?.status = _EffectStatus.Resolved;
  ed?.description += ', duration:${duration?.inMilliseconds}ms';
  if (ed?.effect is EffectWithResult || (!(ed?.effect is Effect))) {
    ed?.description += ', result:($result)';
  }

  _log();
}