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

Futures must be instantiated with an explicit condition=Condition() parameter #12

Closed
aglyzov opened this issue Apr 4, 2014 · 6 comments
Labels
Milestone

Comments

@aglyzov
Copy link
Owner

aglyzov commented Apr 4, 2014

We must instantiate Futures with an explicit condition=Condition() parameter where Condition is obtained from _get_green_tools().
Otherwise a Future would use default threading.Condition() and block other greenlets.

Also we need a test case that proves this.

@aglyzov aglyzov added the bug label Apr 4, 2014
@AxelVoitier
Copy link
Collaborator

Well, it kept throwing exceptions when I was using it with greenlets.
Maybe the latest changes on the green tools fixed it. I have to retry.

@AxelVoitier
Copy link
Collaborator

Now it works, strange.
I will push the modifications then.

@aglyzov
Copy link
Owner Author

aglyzov commented Apr 4, 2014

Thanks Axel,
By the way in which case it raises a TypeError?

@AxelVoitier
Copy link
Collaborator

When the Future class comes from the threading module. It has no kwarg "condition".

@aglyzov
Copy link
Owner Author

aglyzov commented Apr 4, 2014

I see. That's what I thought. I am going to take care of it by replacing get_green_tools() with a more generic get_concurrency_tools() which would also cover the threading case (i.e. no green env). Also it is going to return a proper Future class/wrapper suitable for current env.

@AxelVoitier
Copy link
Collaborator

👍 , that would remove the need for abstract _get_tools methods :).

@AxelVoitier AxelVoitier added this to the 0.4 milestone Apr 9, 2014
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

2 participants