-
Notifications
You must be signed in to change notification settings - Fork 66
Open
Description
I have an issue where it would be nice to add an additional parameter to every service method with some configuration/state information provided when starting the service - so something along the lines of:
AdditionalOptions = ... %% some term
Server = #{grpc_opts => #{service_protos => [my_service],
services => #{'my.myService' => {my_service_handler, AdditionalOptions}}
,...}
grpcbox:start_server(Server)
and then in my_service.erl:
my_service_function(Ctx, Input, AdditionalOptions) ->
...
or alternatively:
my_service_function(Ctx, Input) ->
AdditionalOptions = ctx:get(Ctx, ctx_additional_options),
...
I guess the latter means that the generated behaviours don't need changing...
Any thoughts on a) whether this is a PR that you'd be interested in taking and b) if it is something you'd be interested in, views on what the usage should look like?
Metadata
Metadata
Assignees
Labels
No labels