-
Notifications
You must be signed in to change notification settings - Fork 28
add more taskcluster.async documentation #83
Conversation
README.md
Outdated
|
||
The objects under `taskcluster` (e.g., `taskcluster.Queue`) are python2-compatible and operate synchronously. This allows for taskcluster api access, though for bulk operations will be considerably slower... more than 10x slower in cases where you need to run many api calls that would benefit from concurrency. | ||
|
||
The objects under `taskcluster.async` (e.g., `taskcluster.async.Queue`) require `python>=3.5`. `taskcluster.async` will only be available under the python3 wheel or the source distribution; the python2 wheel will not include it. The async objects use asyncio coroutines for concurrency; this allows us to put I/O operations in the background, so operations that require the cpu can happen sooner. The code would look something like |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The "taskcluster.async will only be available under the python3 wheel or the source distribution; the python2 wheel will not include it"
bit is now no longer the case, since it was going to be a bit of a hack in #82.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One comment, otherwise looks great! Thanks for writing this up.
README.md
Outdated
@@ -44,6 +44,28 @@ but unnamed temporary credentials can be created regardless of your scopes.## AP | |||
The REST API methods are documented on | |||
[http://docs.taskcluster.net/](http://docs.taskcluster.net/) | |||
|
|||
## Sync vs Async | |||
|
|||
The objects under `taskcluster` (e.g., `taskcluster.Queue`) are python2-compatible and operate synchronously. This allows for taskcluster api access, though for bulk operations will be considerably slower... more than 10x slower in cases where you need to run many api calls that would benefit from concurrency. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rather than the sync api is slower inherently, it's more the case that the async api can easily run with concurrency. As it's written, it almost sounds like a single sync call is up to 10x slower than a single async call. Let's frame it more like "This allows for making concurrent API calls, which can considerably improve performance for applicable workloads"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's true it's just as fast on a single sync call. However, anyone using taskcluster-client.py against even medium-sized graphs should see speedups using async. But agreed, I can reword and make it a positive statement for async rather than a negative for sync.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
also, avoid unclosed session errors in the code example.
@jhford how does it look? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great, I like your wording. Thanks @escapewindow
Many thanks! |
Fixes #81 .