Intents/events system #5
Labels
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: glitchy/wschat#5
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Intents/events system
yes i used chatgpt for this cry about it im sleepy rn i wont get this done instantly
To improve client-server synchronization and reduce desynchronization issues, we should implement an intents/events system. This system allows clients to explicitly declare which types of events they want to receive updates about (intents), and the server will push relevant asynchronous event notifications as they occur.
This approach replaces or supplements polling-based mechanisms like
LSSUBSand ensures clients stay up-to-date with minimal network overhead.Proposed Protocol Additions
Intents declaration
Clients declare their interest in specific event types:
Example:
The server confirms intent subscription:
Event notifications
Server asynchronously sends events to subscribed clients:
Examples:
Intent removal (optional)
Clients may unsubscribe from event notifications:
Server confirms:
Implementation Notes
Example Server-side pseudocode
Client-side considerations
EVENTmessages and update UI/state accordingly.Benefits
References