send<T> method

Future<T> send<T>(
  1. int command, {
  2. List args = const [],
  3. CancellationToken? token,
  4. bool inspectRequest = false,
  5. bool inspectResponse = false,
})

Sends a workload to the worker.

Implementation

Future<T> send<T>(
  int command, {
  List args = const [],
  CancellationToken? token,
  bool inspectRequest = false,
  bool inspectResponse = false,
}) {
  // ensure the worker is up and running
  if (_channel != null) {
    return _send(
        _channel!, command, args, token, inspectRequest, inspectResponse);
  } else {
    return start().then((channel) => _send(
        channel, command, args, token, inspectRequest, inspectResponse));
  }
}