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

Singular socket connection #43

Merged
merged 14 commits into from
Apr 17, 2024
Merged

Conversation

runeharlyk
Copy link
Collaborator

Purpose

Closes #29 that states that the current setup requires up to 3 concurrent connections to the server per user, which limits the number of total users. This pr replaces NotificationEvents with EventSocket which can

  • Broadcasts arbitrary data to all connected clients
  • Emits events with payload
  • Pushs toast notifications (like in the old EventNotifications.h) to all clients
  • Accepts event data from the client and call the callback of the concerning stateful service
  • Handles both websocket and SSE

This make it possible for a client to subscribe to a number of events/topics that is of interest. This can be done in +layout.ts or as per route. This saves bandwith as only relevant data is sent to the client

Overall changes:

  • Adds Socket.ts - New Websocket event emitter client
  • Adds EventSocket - New Websocket event emitter server
  • Removes NotificationEvents
  • Updates WebSocketServer - Use new EventSocket
  • Updates AnalyticsService - Use new EventSocket
  • Updates BatteryService - Use new EventSocket
  • Updates DownloadFirmwareService - Use new EventSocket
  • Updates WifiSetttingsService - Use new EventSocket
  • Updates LightStateService - Use new EventSocket

runeharlyk and others added 14 commits April 7, 2024 18:46
# Conflicts:
#	interface/src/routes/demo/Demo.svelte

# Conflicts:
#	interface/src/routes/demo/Demo.svelte

# Conflicts:
#	interface/src/routes/demo/Demo.svelte
# Conflicts:
#	interface/src/lib/stores/analytics.ts
#	interface/src/routes/+layout.svelte
#	interface/src/routes/system/status/SystemStatus.svelte

# Conflicts:
#	interface/src/routes/+layout.svelte
#	interface/src/routes/system/status/SystemStatus.svelte

# Conflicts:
#	interface/src/routes/+layout.svelte
#	interface/src/routes/system/status/SystemStatus.svelte
@runeharlyk runeharlyk changed the title Singular connection Singular socket connection Apr 15, 2024
@theelims theelims changed the base branch from main to eventsocket April 17, 2024 18:38
@theelims theelims merged commit fa827e0 into theelims:eventsocket Apr 17, 2024
@runeharlyk runeharlyk deleted the single-socket branch April 22, 2024 18:50
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

Successfully merging this pull request may close these issues.

Minimize number of parallel sockets
2 participants