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

Provide access to the event loop #2127

Closed
mjhouse opened this issue Jun 30, 2021 · 2 comments
Closed

Provide access to the event loop #2127

mjhouse opened this issue Jun 30, 2021 · 2 comments

Comments

@mjhouse
Copy link

mjhouse commented Jun 30, 2021

Is your feature request related to a problem? Please describe.
I am attempting to write a program that needs to poll a function on a regular basis.

Describe the solution you'd like
I would like to be able to provide a function to the tauri::Builder instance that will be called once-per-iteration inside the event loop.

Describe alternatives you've considered
I've considered and partially implemented a thread-based solution which will be much more complex and difficult to work with.

Additional context
The program in question is for p2p chat, but I think most large applications that communicate across a network would need similar functionality.

@tqwewe
Copy link

tqwewe commented Mar 11, 2022

I see this was closed with a commit, but I'm not quite clear on how to get access to the event loop still. Any ideas?

@Xinyu-Li-123
Copy link

I see this was closed with a commit, but I'm not quite clear on how to get access to the event loop still. Any ideas?

I think this is documented in the Event feature on Tauri's official website. It allows you to emit an event with custom label and custom payload, and to listen to any event by its label.

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

No branches or pull requests

3 participants