-
Notifications
You must be signed in to change notification settings - Fork 9
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
Examples for custom async #10
Comments
Outlined it a bit more here master...johnpmayer:custom_event |
I'm curious which of the two directions you're planning on taking this library:
I'm going to spike out #1 to see what that would feel like |
I'm not entirely sure yet, to be honest. The current API does allow usage of Futures and Future-related code to run custom tasks, entirely without any support from blinds. Custom event types would make waiting for other events easier, but at the cost of complicating the API for other users. |
I've put a bit more work into it. Two things that I ran into
I agree on the trade-off; it's the expansion of both the more complicated EventStream type and the injection of the spawner which make the custom_run API a lot more complicated. |
I guess it really boils down to: should the blinds event loop be something library users interact with or not. |
Taking the other side; I think that would just be exposing an intended-to-be-user-managed event loop. Now that I've taken a dive into the codebase I think it would be straightforward to roll my own. Something more like my original proposal, where waiting for blinds events and waiting for custom events can both happen in the game loop but are otherwise independent phases. |
Moving this topic from ryanisaacg/quicksilver#552
Its seems pretty straightforward to make an async call (like, by using
platter.load_file
), await that call (blocking the application loop) and resume the program execution upon the completion of the call. This will work for situations like loading game initialization data, and may be acceptable in some situations like switching "levels".However, what's not clear is how to setup custom non-blocking events. Something that feels like
I think that this would cover things like sockets/websockets (I have a long-lived connection to the server) as well as remote procedure calls and non-blocking resource loading.
The text was updated successfully, but these errors were encountered: