Python asyncio Integration - Notifications sent Asynchronously #273
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.
Description:
Apprise sends each notification one after another (sequentially). Leveraging the
async
/await
with theasyncio
library would allow one to send all of the pending notifications at the same time.This feature identified in this PR only works with Python 3 platforms. Python v2 users will always send via the synchronous method (as they have in the past).
--disable-async
(-Da
) which allows Python 3 instances of Apprise to behave the way it once did (before this pull request) and sequentially send the notifications.--debug
(-D
) switch to the CLI as well which not only defaults the logging verbosity to DEBUG level, it additionally sets theasyncio
module in debug mode under the hood.async_mode
toFalse
(it defaults toTrue
) in the AppriseAsset() object if you want to go back to the legacy way of sending notifications.Other things to note from this PR:
async_mode
is at a notification service level. So developers can set some notifications to run asynchronously and others to run synchronously if they wish. This is determined by the AppriseAsset loaded per notification plugin.Checklist
flake8
)