send<T> method
Sends an event to the bus. If a handler exists for the topic, it will be called. Returns a Future that completes with the result if EventDTO.completer was called by the handler. If no handler exists, returns null.
Implementation
@override
Future<dynamic> send<T>(T data, {String? path, String? fragment, String? target, Map<String, String>? arguments}) async {
if (isDisposed) {
throw StateError('EventBusIsolate is disposed');
}
if (!_ready) {
throw StateError('EventBusIsolate is not initialized: await waitInit before send');
}
var dto =
EventDTO<T>(data, path: path, fragment: fragment, arguments: arguments, target: target, completer: null);
return _link.request(dto);
}