You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If an adopter already has a reference type that implements a run() method it is currently impossible to support ServiceLifecycle, even though the implementation works easily:
extensionMyExistingService:Service{}
The reason for this is, that ServiceLifecycle uses gracefulShutdown to signal shutdown instead of Task cancellation. That is the correct call. However it is impossible to add gracefulShutdown support to object that already expose a run() method. That's why im proposing that ServiceLifecycle offers a CancelOnGracefulShutdownService<Underlying: Service>.
The text was updated successfully, but these errors were encountered:
Conforming MyExistingService to Service doesn't seem correct as it doesn't support graceful shutdown.
Perhaps we need another protocol CancellableService for a Service that is only cancellable. Then your service could look like
I am not yet sure we need this. In one of the latest releases we introduced support to escalate graceful shutdown to cancellation. This should help with services that don't support graceful shutdown right now.
I would like to wait for more user reports here if we really need such a new protocol
If an adopter already has a reference type that implements a
run()
method it is currently impossible to support ServiceLifecycle, even though the implementation works easily:The reason for this is, that ServiceLifecycle uses gracefulShutdown to signal shutdown instead of Task cancellation. That is the correct call. However it is impossible to add gracefulShutdown support to object that already expose a
run()
method. That's why im proposing thatServiceLifecycle
offers aCancelOnGracefulShutdownService<Underlying: Service>
.The text was updated successfully, but these errors were encountered: