-
Notifications
You must be signed in to change notification settings - Fork 824
Open
Labels
enhancementDoes it add or improve content?Does it add or improve content?
Milestone
Description
The events guide contains examples showing how to emit events to the backend:
// emits the `click` event with the object payload
emit('click', {
theMessage: 'Tauri is awesome!'
})
Note that emit returns an empty promise, which is discarded here and suggests an incorrect usage of the API. I suggest that the docs should answer at least these questions:
- Can these promises be safely discarded without introducing leaks or race conditions with other events or commands? If so...
- In what circumstances should one await the promise?
- Are events received in the same order as they are sent, independent of whether the promise is awaited?
My use case:
I will use pure events as the primary comms channel for my app, which can mean thousands of events in both directions. I need strict ordering guarantees and to prevent leaks. I don't need confirmation of delivery (if so, I would have used commands/invoke). All else equal, I'd prefer not to use promises - since it'd require me to asyncify parts of my application without any inherent concurrency.
FibreFoX and simonhyll
Metadata
Metadata
Assignees
Labels
enhancementDoes it add or improve content?Does it add or improve content?
Type
Projects
Status
πͺ Ready