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

Common data #33

Closed
wlandau opened this issue Mar 7, 2023 · 4 comments
Closed

Common data #33

wlandau opened this issue Mar 7, 2023 · 4 comments
Assignees

Comments

@wlandau
Copy link
Owner

wlandau commented Mar 7, 2023

clustermq has a feature called "common data": objects that are part of the worker environment for all tasks. These objects need only get sent once, rather than with each new task. If the objects get assigned to .GlobalEnv on the worker (@mschubert, is this what clustermq does?), then I can implement this feature in crew without asking @shikokuchuo to implement it in mirai::server().

@wlandau wlandau self-assigned this Mar 7, 2023
@mschubert
Copy link

Yes, that's what clustermq currently does.

However, please note that I'm transitioning to a system where the master environment gets updated on the workers automatically.

@wlandau
Copy link
Owner Author

wlandau commented Mar 7, 2023

Thanks for explaining. In the new system, is the master environment still the same as .GlobalEnv? When you say the master environment gets updated automatically, does that have to do with the handshake that uses the set_common_data() and send_common_data() methods?

@mschubert
Copy link

is the master environment still the same as .GlobalEnv?

Yes, at least for now.

When you say the master environment gets updated automatically

You will be able to add additional objects to the master at any point, which will then be propagated to the workers (that can then reuse them in subsequent calls)

@wlandau
Copy link
Owner Author

wlandau commented Mar 12, 2023

I did more experiments with nanonext, and it seems like both the listener and the dialer need to both be connected in order for me to send the messages I would need to implement common data. This forces a level of synchronicity that would require me to implement an active daemon to watch for common data messages, and this is not feasible in crew. Fortunately, mirai is very fast, so common data may not even be necessary,

@wlandau wlandau closed this as completed Mar 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants