Add on_success and on_failure callback kwargs #118
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
As noted in #116 there is no support for
on_success
oron_failure
callbacks. This adds themI'm using this in my application and it seems to work fine. If someone else would like to test, it can be installed with the following:
Pip
Manual / from the filesystem using pip or setuptools
or ...
As a dependency in setuptools
In
setup.cfg
, use:As a dependency in
requirements.txt
onlyIf using
requirements.txt
only:As a dependency in
requirements.txt
andconstraints.txt
(the "proper" way to do this)requirements.txt
:constraints.txt
:Caveats
I don't make exhaustive use of all of the features of Flask-RQ2 so it's quite possible I made a mistake. Anyone who may want to test/review is appreciated. This has NOT been reviewed by the Flask-RQ2 devs
Usage
The use is as one would expect, it just adds two kwargs to the
queue()
function. The usage is as described in #116 , duplicated here:Alternately, you can use the following style, opting to specify the callbacks when defining the function- same as with any other kwargs: