subscribeLazyPayloadHandler method

Future<Subscribed> subscribeLazyPayloadHandler(
  1. String topic,
  2. void onEvent(
    1. LazyEventPayload event
    ), {
  3. SubscribeOptions? options,
})

This subscribes the session to a topic and routes lazy payload views directly to onEvent so encoded payload bytes can be forwarded without forcing immediate decode.

Implementation

Future<Subscribed> subscribeLazyPayloadHandler(
  String topic,
  void Function(LazyEventPayload event) onEvent, {
  SubscribeOptions? options,
}) {
  return _subscribe(
    topic,
    options: options,
    configure: (subscribed) => subscribed.onLazyEventPayload(onEvent),
  );
}