run method

Future<Response_T?> run({
  1. required StreamController<Message_T> stream,
  2. Request_T? request,
})

Implementation

Future<Response_T?> run({
  required StreamController<Message_T> stream,
  Request_T? request,
}) async {
  await _lock.lock();
  try {
    final asyncRunner = await super.nextAvailableRunner;

    return asyncRunner.runWithStream<Request_T, Response_T, Message_T>(
      task: task,
      stream: stream,
      request: request,
    );
  } finally {
    _lock.unlock();
  }
}