enqueueCall<TArgs, TResult> method

Future<String> enqueueCall<TArgs, TResult>(
  1. TaskCall<TArgs, TResult> call
)

Mimics Stem.enqueueCall and records the request.

Implementation

Future<String> enqueueCall<TArgs, TResult>(
  TaskCall<TArgs, TResult> call,
) async {
  final options = call.resolveOptions();
  final id = generateEnvelopeId();
  _enqueues.add(
    RecordedEnqueue(
      id: id,
      name: call.name,
      args: call.encodeArgs(),
      headers: Map<String, String>.from(call.headers),
      options: options,
      notBefore: call.notBefore,
      meta: Map<String, Object?>.from(call.meta),
      enqueuedAt: stemNow(),
      call: call,
    ),
  );
  return id;
}