marcoferrer / kroto-plus

gRPC Kotlin Coroutines, Protobuf DSL, Scripting for Protoc
Apache License 2.0
494 stars 28 forks source link

Allow server implementations to configure `CoroutineStart` strategy for rpcs #46

Open marcoferrer opened 5 years ago

marcoferrer commented 5 years ago

It would be really useful to be able to configure what CoroutineStart strategy is used for invoking rpc methods. The most straight forward approach is to introduce a new field to the ServiceScope interface. One thing to consider for this api is whether or not it should be configurable on a per rpc basis.

The field should default to CoroutineStart.DEFAULT and only allow ATOMIC and UNDISPATCHED as possible values. We're preventing usage of LAZY since it doesnt make sense in this case and introduces issues.