sendStream method
Implementation
Stream<dynamic> sendStream(Stream<dynamic> requestStream) async* {
await for (var request in requestStream) {
try {
var handler = _handlers[request.runtimeType];
if (handler == null) {
throw Exception('No handler registered for ${request.runtimeType}.');
}
var result = await handler.handle(request);
yield result;
} catch (e) {
print('Error handling request: $e');
}
}
}