Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inject TaskQueue and remove global TaskQueue? #61

Open
mtdowling opened this issue Feb 24, 2017 · 0 comments
Open

Inject TaskQueue and remove global TaskQueue? #61

mtdowling opened this issue Feb 24, 2017 · 0 comments
Labels
Milestone

Comments

@mtdowling
Copy link
Member

If we're brainstorming on 2.0 ideas... then what about removing the concept of a global dependency on a TaskQueue? In the current implementation, promises are added to a global TaskQueue. That queue can also be swapped out for other queues if needed (like React), but doing so might have implications on other aspects of an application that were relying on a different global TaskQueue's behavior. The bigger problem is that because there's a global TaskQueue, Guzzle can't be used in multiple threads.

A better approach would be to require that a promise is created with a reference to the TaskQueue so that chaining off of a promise would add the tasks to the right queue.

This kind of change would probably require another abstraction and a lot of work to ensure it is ergonomic. I'd also be interested to see if we could ensure that there is not a circular reference between a promise and a TaskQueue.

@mtdowling mtdowling added this to the 2.0.0 milestone Feb 24, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant