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
Is your feature request related to a problem? Please describe.
Not being able to pass a cancellationToken to the job worker is restricting me to stop the worker upon request from some background service is stopped.
Describe the solution you'd like
Add an optional CancellationToken parameter to either ZeebeClient.NewWorker or JobWorkerBuilder.Open methods.
In JobWorker class add also CancellationToken parameter and if this one is not null use CancellationTokenSource.CreateLinkedTokenSource instead of new CancellationTokenSource like now.
Also take care about the difference on how the instance was created in the Dispose method of JobWorker so that we don't cancel/dispose twice the token/tokenSource.
Describe alternatives you've considered
The only solution I came up until now is to explicitly call the dispose on the job worker (without knowing the status of the encapuslated cancellationTokne). This is not a desired behavior as the job worker should automatically close when the "external" cancellationToken gets cancelled.
Additional context
None
The text was updated successfully, but these errors were encountered:
Is your feature request related to a problem? Please describe.
Not being able to pass a cancellationToken to the job worker is restricting me to stop the worker upon request from some background service is stopped.
Describe the solution you'd like
Add an optional CancellationToken parameter to either ZeebeClient.NewWorker or JobWorkerBuilder.Open methods.
In JobWorker class add also CancellationToken parameter and if this one is not null use CancellationTokenSource.CreateLinkedTokenSource instead of new CancellationTokenSource like now.
Also take care about the difference on how the instance was created in the Dispose method of JobWorker so that we don't cancel/dispose twice the token/tokenSource.
Describe alternatives you've considered
The only solution I came up until now is to explicitly call the dispose on the job worker (without knowing the status of the encapuslated cancellationTokne). This is not a desired behavior as the job worker should automatically close when the "external" cancellationToken gets cancelled.
Additional context
None
The text was updated successfully, but these errors were encountered: