-
Notifications
You must be signed in to change notification settings - Fork 12
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
Example of using switchback with futures? ..Or propose alternate way to accomplish? #22
Comments
What is Your options are to either run this external library use blocking IO and run it in a thread pool ( |
If you read my reply (previous, deleted)--trying to condense and clarify. It's a custom pycurl client I made..specifically trying to integrate with gruvi and pyuv, because I love eventloops. client.req() returns a future. the request WORKS as in its processed, but when I try to 'read' the result, gruvi complains that I can not view .result() from the main hub. So, yes, its specifically for gruvi. My question I guess is how can I read the future's result? Does it need to be 'inside' a switchback, or..? |
I think I may just be confused, heh. Right now, my issue when putting a request into a Fiber, and get_hub().switch(), is that if Im trying to do multiple requests, it just stops after the first (i.e. loop is still running, but doesn't go on to next request). ugh. Im going to mess around w/things for a few more days so I don't waste your time. I kind of didn't look at the Poller docs before. |
OK. https://gist.github.com/brizzbane/b799ef86fa73ea119308 @ the bottom main. Only the first item in the list proceeds. Am I misunderstanding something fundamental?
I'm wanting to use pycurl + pyuv, because I also believe it to be best available implementation of an eventloop. Your library and rationale really strike a cord w/me, so wanting to understand how to work w/it properly (and read the result of futures). If you have the time to help, would be much appreciated. If you find value w/any of the pycurl + implementation I have, feel free to grab it and publish. There is still a lot of code in above gist from different ways I've tried implementing handling file descriptor events. |
Hi @brizzbane , not sure if you are still interested in this given that you reported this a long time ago. Recently I have gotten some free time again to work on Gruvi. If you're still trying to get this to work, please share a preferably small and standalone reproducer. Happy to have a look. |
Love what you made. I've been wanting to figure this out for a while, but have been hesitant to ask.
Can you help me with this.., not sure if I'm understanding how to use get_hub().switch() correctly.
Here is an example of what I'm trying to accomplish..
So combining Fibers & (ultimately) results of the values of Futures. Didn't see any examples using gruvi.get_hub().switch() AND switchback.
MUCH appreciated.
The text was updated successfully, but these errors were encountered: