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

User event handling with the trait approach #1

Open
kchibisov opened this issue Jan 6, 2024 · 1 comment
Open

User event handling with the trait approach #1

kchibisov opened this issue Jan 6, 2024 · 1 comment

Comments

@kchibisov
Copy link
Member

Generally one may use an associated type or generic on the event loop, but it'll make API a bit complex and more prone to not being object safe, since the intention is to rely on &dyn T a lot.

I think what we can do is to develop an interface to Wakeup the event loop and then just notify that the loop got woken up, then the users can drain their sources of user events, like channels, Mutex<Vec>, etc.

@kchibisov
Copy link
Member Author

The said approach is implemented with the EventLoopProxy type, so the loop could be woken up.

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

No branches or pull requests

1 participant