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

Using several websockets with high incoming data rate and queues #102

Open
yimyom opened this issue May 21, 2023 · 0 comments
Open

Using several websockets with high incoming data rate and queues #102

yimyom opened this issue May 21, 2023 · 0 comments

Comments

@yimyom
Copy link

yimyom commented May 21, 2023

Hi,

I'm looking for an efficient pattern to do the following:

  • I need to connect to several websocket which send a lot of data at a high rate (it's common to see 20-30 messages/second)
  • I want to store the incoming data in queues, one for each websocket.
  • then I have a main process which reads the queues and process them asynchronously.

Now here is my problem: in an ideal world, I would like to have one thread for each websocket and its queue and the main thread will read from the queue at its own rate. Now, I don't want to have slow IPC like in most of the R packages (futures, ipc, promises, etc...) which rely on local files. I need very fast communications (like shared memory for example).

How would you approach this problem?

(I know it's not an "issue" with websocket per se but it's still related to it, because I'd like to have not only the internal websocket in a thread but also the $onMessage method too)

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