-
Notifications
You must be signed in to change notification settings - Fork 24
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
Support multiple clients at once. #11
Comments
As per my understanding, this will require starting multiple R processes to achieve this, so that's not that different than starting multiple actual |
It is quite a bit different from running multiple independent processes behind a load balancer. ?mcfork :
Something like this will be required if I'm ever going to get the streaming methods working. |
This is the approach taken by Rserve and inherited by RestRserve. Works nicely and very performant. The issue is only when it is needed to change the state of the parent process. This is complex and requires not trivial inter-process communication. |
Oh, I was not aware of the fact that forks are using the same memory of unmodified objects, I thought each fork becomes an actual copy of current state - despite the fact that I have been using forks extensively :) Also thanks for the RestRserve pointer, looks great! I've been using Rapache quite a lot, it's great to see that nowadays there is an actual alternative! |
Right now, server mode can only handle one client at a time - the first client must hang up before the server can begin processing the second request.
To fix this, for each request, we should run each response in a different thread drawn from a thread pool.
Initially I planned on using RcppParallel, but it's README explicitly says not to access any R APIs from its workers.
My alternative plan is modify the server callback wrapper code to call through
mcparallel
- this will preclude (theoretical anyway) windows support, but is the next step towards fully implementing the grpc api.The text was updated successfully, but these errors were encountered: