registerEventBusServer static method
Register an implementation of grpcdc.events.v1.EventBus on a Server.
Implementation
static void registerEventBusServer(Server server, EventBusServer impl) {
server.registerService(ServiceDesc("grpcdc.events.v1.EventBus", [
Method("Publish", "/grpcdc.events.v1.EventBus/Publish", Server.kindUnary,
(ctx, reqs, sink) async {
final req = PublishRequest();
await reqs.recvInto(req);
sink((await impl.publish(ctx, req)).marshalDc());
}),
Method("Subscribe", "/grpcdc.events.v1.EventBus/Subscribe",
Server.kindServerStreaming, (ctx, reqs, sink) async {
final req = SubscribeRequest();
await reqs.recvInto(req);
await impl.subscribe(req, _EventBusSubscribeServerImpl(ctx, sink));
}),
]));
}