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
Think both proposals are good ideas that help with the use case you describe.
I think it would be good to make two adjustments:
Add a protected method you describe so you're able to check whether a shutdown was requested. This makes it possible to abort longer running jobs at a point where you can control it. (However I still would recommend to make the iterations as small as possible, this can come in handy right before or after you access something over the network for example.)
It's weird an iteration is executed after you've requested a shutdown, so I think the do { } while-loop should be changed to a while loop that checks for a shutdown at beginning of the first iteration already.
Would you be able to create a PR for these changes? Happy to merge it in!
My usecase relies on some complex initialization i the initialize() method, and if it fails, it requests shutdown through
$this->shutdown();
But Ive noticed that even then the
execute()
method is called at least once.My proposal is:
isShutdownRequested(): bool
(the property is now private, so no way to access this)WDYT?
The text was updated successfully, but these errors were encountered: