registerHandler method

Future<Registered> registerHandler(
  1. String procedure,
  2. FutureOr<void> onInvoke(
    1. Invocation invocation
    ), {
  3. RegisterOptions? options,
})

This registers a procedure and routes invocations directly to onInvoke without requiring the caller to touch Registered.invocationStream.

Implementation

Future<Registered> registerHandler(
  String procedure,
  FutureOr<void> Function(Invocation invocation) onInvoke, {
  RegisterOptions? options,
}) {
  return _register(
    procedure,
    options: options,
    configure: (registered) => registered.onInvoke(onInvoke),
  );
}