send method

Future<void> send({
  1. String? methodName,
  2. List? args,
})

Invokes a hub method on the server using the specified name and arguments. Does not wait for a response from the receiver.

The Promise returned by this method resolves when the client has sent the invocation to the server. The server may still be processing the invocation.

Implementation

Future<void> send({
  String? methodName,
  List<dynamic>? args,
}) {
  final streamParameters = _replaceStreamParameters(args);
  final sendPromise = _sendWithProtocol(
    _createInvocation(
      methodName: methodName,
      args: args,
      nonblocking: true,
      streamIds: streamParameters.item2,
    ),
  );

  _launchStreams(streamParameters.item1, sendPromise);

  return sendPromise;
}