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

Support for once to listen for an event only 1 time (Like official socket.io server has) #1997

Closed
kingdevnl opened this issue Jun 30, 2023 · 1 comment

Comments

@kingdevnl
Copy link

Is your feature request related to a problem? Please describe.
For example to request user input from a socket and to only handle the output once.

Describe the solution you'd like
Sending a event to the client requestInput -> {"title": "Enter name of file"}
then in the client ask for input, then send the the respsonse to the server
In the server write the data to for example redis.

Additional context
Add any other context or screenshots about the feature request here.

@miguelgrinberg
Copy link
Owner

miguelgrinberg commented Jun 30, 2023

Unlike the JavaScript libraries, these use a more Pythonic approach based on decorated event handlers and do not allow adding and removing event handlers while the application is running. You set up your handlers before the server start, and then those handlers remain active. With this in mind, I think it isn't really clear how to implement what you are asking.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants