-
Notifications
You must be signed in to change notification settings - Fork 4
Open
Description
Currently, connect-python
generated server constructor creates a new ConnectWSGI
instance in each service function:
def wsgi_eliza_service(implementation: ElizaServiceProtocol) -> WSGIApplication:
app = ConnectWSGI()
app.register_unary_rpc("/connectrpc.eliza.v1.ElizaService/Say", implementation.say, eliza_pb2.SayRequest)
...
return app
However, this makes hard to register multiple ConnectRPC services on a single WSGI application - scenarios like serving multiple services in a single instance or implementing health checking protocol.
I think it would be nice for the service constructor to take a ConnectWSGI
instance as an argument to allow registering more than one service like below:
def wsgi_eliza_service(implementation: ElizaServiceProtocol, app = ConnectWSGI()) -> WSGIApplication:
app.register_unary_rpc("/connectrpc.eliza.v1.ElizaService/Say", implementation.say, eliza_pb2.SayRequest)
...
return app
Metadata
Metadata
Assignees
Labels
No labels