subscribe method
Register a handler
to subscribe to messages sent to the topic.
Implementation
Future<void> subscribe(MessageHandler handler,
{List<MessageHandler> middlewares = const []}) async {
var registrationRequest = $tp.RegistrationRequest(topicName: name);
final composedHandler =
composeMiddleware([...middlewares, handler], MessageContext.fromCtx);
var worker = SubscriptionWorker(registrationRequest, composedHandler);
await worker.start();
}