-
Notifications
You must be signed in to change notification settings - Fork 4
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
A dispatcher process for {crew} workers #107
Comments
Sorry I've not had the bandwidth to respond to your previous questions yet. I will get to these. |
Once I have confirmation that shikokuchuo/mirai#69 is fixed, I'll put something together that will show you how easy it is (hopefully). I do want to prioritise fixing any remaining bugs before the possibility of introducing new ones with further development. |
Using another dispatcher process is fine, but syncing the variables does present a problem. Previously when we were just using 'bus' sockets, that may have been more plausible as they are multicast. However, we have seen that only req/rep will do. Instead it will be much easier if it works to run your functions on dispatcher itself, to be evaluated directly in that context. If you need another socket to send information back to host then you can still prototype that using the current limited interface, and we can add that as a setup step for efficiency later if needed. Using the same process also solves your other issue #108 about how to sync with dispatcher events. I have pushed a 'dispatcher' branch to Included is the option of supplying either a function or call. I suspect a function will be easier, and avoids the additional frame through an eval() call. Unless something complicated is required, in which case additional arguments to I have tested very briefly by using However let me know if structurally something is missing. Also just a note that this feature is definitely for after the next CRAN release of |
That's fantastic, @shikokuchuo! I can't wait to try this! As soon as I emerge from this latest development sprint on cloud storage with |
Given shikokuchuo/mirai#78 (reply in thread), I am not so sure the extended R dispatcher would work for The obvious alternatives range from challenging to infeasible:
Fortunately though, |
If I really need to, I will come back to #105 for this. But it is a huge undertaking to implement, especially compared to how simple |
mirai
has an active dispatcher process for tasks. I am thinking I could implement a different one forcrew
workers in order to free up control in the parent process. @shikokuchuo, this may be easier than even the light-touch fused dispatcher we talked about before.Worker dispatch in
crew
requires knowledge of how many workers are active (usingmirai::status()
) and the number of unresolved tasks. I wonder, is it possible to callmirai::status()
from a different process than the one that calledmirai::daemons()
? And what would be the best way to count unresolved tasks from acrew
worker dispatcher process?The text was updated successfully, but these errors were encountered: