registerPayloadHandler method

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

This registers a procedure and routes invocation payloads directly to onInvoke without forcing Invocation allocation on the native fast path.

Implementation

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