Adds support for async/await API calls (no deps)#16
Merged
fguillot merged 2 commits intokanboard:masterfrom Jul 30, 2019
karthanistyr:feature/async_differently
Merged
Adds support for async/await API calls (no deps)#16fguillot merged 2 commits intokanboard:masterfrom karthanistyr:feature/async_differently
fguillot merged 2 commits intokanboard:masterfrom
karthanistyr:feature/async_differently
Conversation
**BREAKING**: Drops support for python 2.7 and < 3.5 (it relies on asyncio (so 2.7 is out), and python versions below 3.5 have different behaviours regarding the thread pool, see: https://docs.python.org/3/library/asyncio-eventloop.html#asyncio.loop.run_in_executor). I am suggesting this change for your consideration. Backwards compatibility has been preserved by running the synchronous `kanboard.client.Kanboard.execute` method into an asyncio executor (for now, only the default executor can be used, but the event loop can be customised via Kanboard() ctor) Basic usage is to use the coroutines mapped by method calls with the _async suffix. Example: for a given kb object (of type Kanboard) Synchronous: kb.create_project(name="My project") Asynchronous: kb.create_project_async(name="My project") Fixes #14 Signed-off-by: Antoine Mazeas <antoine@karthanis.net>
Signed-off-by: Antoine Mazeas <antoine@karthanis.net>
Contributor
Author
|
There are no added dependencies with this take on the async/await compatibility. sample_program.py |
Member
|
LGTM. Thanks! |
This file contains hidden or 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
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
BREAKING:
Drops support for python 2.7 and < 3.5 (it relies on asyncio (so 2.7 is out), and python versions below 3.5 have different behaviours regarding the thread pool, see: https://docs.python.org/3/library/asyncio-eventloop.html#asyncio.loop.run_in_executor).
I am suggesting this change for your consideration.
Backwards compatibility has been preserved by running the synchronous
kanboard.client.Kanboard.executemethod into an asyncio executor (for now, only the default executor can be used, but the event loop can be customised via Kanboard() ctor)Basic usage is to use the coroutines mapped by method calls with the _async suffix.
Example: for a given
kbobject (of type Kanboard)Synchronous:
kb.create_project(name="My project")Asynchronous:
kb.create_project_async(name="My project")Fixes #14 (replaces PR #15)