execute<T1, T2> method
Future<T2>
execute<T1, T2>({
- required TransferMode mode,
- required T1 producer(),
- required T2 job(
- T1
Plan job for further execution in the worker.
Execute is a two-phase operation:
producerfunction is executed on the caller's thread.- The result of
producerandjobfunction pointer is being added to jobs queue of the selected worker.
Note that job must not capture any state itself.
Parameter mode has no effect.
Return the future with the computation result of job.
Implementation
external Future<T2> execute<T1, T2>({
required TransferMode mode,
required T1 Function() producer,
required T2 Function(T1) job,
});