Skip to content
This repository has been archived by the owner on Oct 5, 2020. It is now read-only.

add more taskcluster.async documentation #83

Merged
merged 3 commits into from
Aug 11, 2017
Merged

add more taskcluster.async documentation #83

merged 3 commits into from
Aug 11, 2017

Conversation

escapewindow
Copy link
Contributor

Fixes #81 .

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
Copy link
Contributor

@edmorley edmorley Aug 8, 2017

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.

Copy link
Contributor

@jhford jhford left a 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.
Copy link
Contributor

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"

Copy link
Contributor Author

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.

Copy link
Contributor Author

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.
@escapewindow
Copy link
Contributor Author

@jhford how does it look?

Copy link
Contributor

@jhford jhford left a 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

@jhford jhford merged commit 515a973 into taskcluster:master Aug 11, 2017
@edmorley
Copy link
Contributor

Many thanks!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants