call method

  1. @override
Future<void> call(
  1. Effect effect,
  2. MsgEmitter<Msg> emit
)
override

Queues an effect for processing and starts the processing loop if not already active.

  • effect: The effect to process.
  • emit: A function to emit messages as a result of processing the effect.

Implementation

@override
Future<void> call(
  Effect effect,
  MsgEmitter<Msg> emit,
) async {
  _queue.add((effect, emit));
  if (!_isProcessing) {
    unawaited(_process());
  }
}