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

Open connections? #6

Open
carueda opened this issue Sep 25, 2023 · 2 comments
Open

Open connections? #6

carueda opened this issue Sep 25, 2023 · 2 comments
Labels
enhancement New feature or request

Comments

@carueda
Copy link
Member

carueda commented Sep 25, 2023

Hi @kevinsbarnard

Just a suggestion, not critical at all but potentially useful, and perhaps not difficult to implement (I would have gone with a PR already, but I'm less familiar with websockets in python and time is scarce):

Have the server report:

  • asynchronously, that is, via websocket event (as any other, but with some special metadata_ prefix or something for the name of the event):

    • A new client has connected
    • A client has disconnected
  • synchronously, that is, via regular http request:

    • number of currently connected clients

I have functionality like the above for the Dash, and this has been very useful specially for monitoring performance, see actual use of the system at any given moment, and the like.

@kevinsbarnard kevinsbarnard added the enhancement New feature or request label Sep 27, 2023
@kevinsbarnard
Copy link
Collaborator

Hi @carueda

synchronously, that is, via regular http request:

I've added a rudimentary HTTP server alongside the WebSocket server. See the http-server branch if you want to give it a spin -- it runs on 1 + the specified port and just returns a JSON blob with the number of connected clients for a GET request on any path. I also reworked logging a tiny bit so you can change verbosity from the command line.

asynchronously, that is, via websocket event (as any other, but with some special metadata_ prefix or something for the name of the event):

I'm hesitant to implement the async reporting of clients connecting/disconnecting as it would muddy the schema a bit (clients would need to know about this special case). Maybe a separate endpoint for this to opt-in would suffice, but I need to think about this more (time is also scarce on my end).

@carueda
Copy link
Member Author

carueda commented Sep 27, 2023

Hi @kevinsbarnard, thanks, great progress; again, this is just a nice-to-have, as-time-permits kind of thing. Appreciate the effort!

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
None yet
Development

No branches or pull requests

2 participants