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

Minimize number of parallel sockets #29

Closed
theelims opened this issue Apr 1, 2024 · 6 comments · Fixed by #43
Closed

Minimize number of parallel sockets #29

theelims opened this issue Apr 1, 2024 · 6 comments · Fixed by #43
Assignees
Labels
enhancement New feature or request

Comments

@theelims
Copy link
Owner

theelims commented Apr 1, 2024

Right now the Lightstate Demo uses 2 sockets for SSE and WS and need a 3rd socket to update the HTTP pages. PsychicHttp limits the available sockets to 5 crippling the number of devices available for concurrent connections.

  1. Create a UnifiedWebSocketServerEndpoint to use only one socket per frontend connection
  2. Merge the NotificationEvents (SSE) into this UnifiedWebSocketServerEndpoint
  3. Use this additionally as an endpoint for the lightstate demo to show both usecases
@theelims theelims added the enhancement New feature or request label Apr 1, 2024
@theelims theelims self-assigned this Apr 1, 2024
@theelims theelims moved this to 🔖 Next Release in ESP32 SvelteKit Apr 1, 2024
@theelims
Copy link
Owner Author

theelims commented Apr 6, 2024

@runeharlyk I was looking around your github repos and found your work on the sockets, as well your previous ESP32 svelte template. Maybe we can sit down and discuss a couple of things round these two. Especially I am interested in your experience with that single file vite plugin. Does this work for SvelteKit? Right now the frontend creates ~64 endpoints. Each endpoint consumes a few bytes in heap. Thus larger apps with a heavier frontend put a lot of pressure on the available heap and it would be preferable to reduced the number endpoints significantly.

@theelims theelims moved this from 🔖 Next Release to 🏗 In progress in ESP32 SvelteKit Apr 6, 2024
@runeharlyk
Copy link
Collaborator

Very cool, I would definitely want to discuss them.

As for the single-file-plugin - It only works with single entry apps as the plugin uses the inlineDynamic option which is not supported by rollup if there are multiple entries (See this issue ). That is the reason my simple template only uses svelte with svelte-router.
But maybe we can build a new plugin that get around this restriction.

@theelims
Copy link
Owner Author

theelims commented Apr 6, 2024

Would you be open for other communication channels like discord? My handle is the same as on github.

I would like to understand how you do you socket implementation. From my point of view it should replace SSE and be available as a further endpoint (with the same mechanic and API as the other endpoints) for custom services.

The other topic seems to be tough nut to crack open: sveltejs/kit#3882

@runeharlyk
Copy link
Collaborator

I tried adding you, but it seem like i cant send you a friend request. Maybe you can try adding me. My handles also match.

@theelims
Copy link
Owner Author

theelims commented Apr 7, 2024

I did sent you a request and also activated that everybody can send my a friend request.

@theelims
Copy link
Owner Author

This issue is closed and a Event Socket System based on a single WebSocket connection will be included in the next release.

@github-project-automation github-project-automation bot moved this from 🏗 In progress to ✅ Done in ESP32 SvelteKit Apr 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

2 participants