-
Notifications
You must be signed in to change notification settings - Fork 171
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
labeled-response hooks #1483
Labels
Comments
Another random idea, but unrelated to labeled-response, but related to the latter: it could be useful to have async procedures like this to wait for an action; eg. when implementing turn-based games waiting for players to run a command. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
To fully benefit from labeled-response, we should provide an easy way for plugins to send a message and run code on a reply without manually managing state.
Current pseudo-code:
That's a lot of boilerplate, so I'd like to provide a simple API like this to plugins:
Or maybe even introduce async command functions:
The later is the most developer-friendly because it reuses the frame instead of explicitly passing state, but it is going to be a real strain on the event loop (unless we implement it in
callbacks.Callback.__call__
? or maybe a new plugin class incallbacks
? or even make it an external library that defines a abstract callback class that plugins can inherit to use async?)The text was updated successfully, but these errors were encountered: