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

Merging 2 websockets into a single one #328

Open
spyflox opened this issue Aug 2, 2023 · 0 comments
Open

Merging 2 websockets into a single one #328

spyflox opened this issue Aug 2, 2023 · 0 comments

Comments

@spyflox
Copy link

spyflox commented Aug 2, 2023

I currently have 2 services:

  • 1 to manage my inputs (InputsStateService)
  • 1 to manage my outputs (OutputsStateService)

I want to create a dashboard on the interface that gives me real-time status updates of my inputs and outputs.
Currently, I am using 2 websockets.

Since my outputs change almost simultaneously with my inputs, I would like to have a single websocket that "merges" the 2 JSON outputs from InputsStateService and OutputsStateService.
Ideally, I would like to remove the websockets from InputsStateService and OutputsStateService and have a third service called DeviceStateService that handles this websocket.
I need to keep StatefulService to handle everything else : MQTT management, read and update state etc.

My knowledge of C is limited.
How can I create a single instance of InputsState and OutputsState and use them in InputsStateService and DeviceState (or in OutputsStateService and DeviceState?

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

No branches or pull requests

1 participant