It's currently too easy to forget to issue an Invocation::yield from within RPC handlers. It should be changed so that the RPC handler is forced to return one of the following:
a RESULT with optional payload and optional advanced attributes,
an ERROR result, which could also be thrown from within the RPC handler
a special "no result" type that explicitly indicates that the RPC already has, or will be, manually returning a result via Invocation::yield. This makes it possible for the user to return the result in a different asynchronous handler context.
A discriminated union type could be used to contain those three variants, without incurring the cost of dynamic allocation if polymorphism was used instead.
It's currently too easy to forget to issue an
Invocation::yield
from within RPC handlers. It should be changed so that the RPC handler is forced to return one of the following:Invocation::yield
. This makes it possible for the user to return the result in a different asynchronous handler context.A discriminated union type could be used to contain those three variants, without incurring the cost of dynamic allocation if polymorphism was used instead.