-
Notifications
You must be signed in to change notification settings - Fork 604
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add parameter for
on_error
to BusABC.send_periodic
If there is an error while sending messages in a (background) periodic task, then the `on_error` callback is called, if set. If the callback is configured and returns `True` then the task continues, otherwise it is aborted. While it is possible to update a task with a callback after the task has been created, this procedure is prone to a race condition where the callback might not be configured in time for the first send event. Thus, if the first send fails and the callback has not yet been configured, the task will abort. This commit solves the race condition issue by adding an argument to `BusABC.send_periodic` to specify the callback. By including the callback in the constructor it will be deterministically active for all sends in the task. This fixes issue #1282. This commit also adds myself to the CONTRIBUTORS list.
- Loading branch information
Showing
2 changed files
with
18 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -81,4 +81,5 @@ Felix Nieuwenhuizen | |
@fjburgos | ||
@pkess | ||
@felixn | ||
@Tbruno25 | ||
@Tbruno25 | ||
@andebjor |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters