I don’t get mechanics for cancellation tokens and web jobs.
I know what I can use Microsoft.Azure.WebJobs.WebJobsShutdownWatcher().Tokento get a token and respond to token.IsCancellationRequested, for example, when updating WebJobs.
Scenario:
A continuous job caused by a service bus message. The job calls a method in my data layer. This method performs some updates in different azure sql database tables. This method works for about two minutes.
Now I will transfer the token to the data layer, and there I will do my work until no cancellation is canceled; otherwise I would finish my updates.
Now the questions are:
Does the job owner go to wait for my method to complete and then stop?
Should I set the value of "stopping_wait_time" to a value (what is the default?) High enough to make sure my work is completed correctly?
If a new message is written to the service bus queue, does this message start a new job even though a pending reject is expected?
Thanks for any clarification!
source
share