Message based context
shairozan opened this issue · comments
It may make sense to just use a context for the message structure to mark cancellation as opposed to returning the error structure up the stack. Worth investigating.
Might also mean that we would need an interface for a SIP message that might define GetContext
and CancelContext
. This would allow the engine and the messages to have their own discrete contexts, and we could cancel messages based on that rather than evaluating the errors returned from execution to determine whether we should halt future steps
So the simple answer is that the objects themselves should not have context. I need to re-tool the interfaces such that contexts are passed to the functions themselves. This will allow the server to have its own context, and handle new ones for each child on execution. Will also make gRPC integration easier