How severe does this issue affect your experience of using Ray? Low
I have a use case where I need to ensure that some code ( i.e.
init() ) runs at the launch of every worker process and any new subsequent worker process in the future.
For now I am just inserting the code into every Ray task and actor like so:
@ray.remote def task_a(): init() @ray.remote def task_b(): init() @ray.remote class Actor_a(): def __init__(self): init()
However defining this
init() gets redundant if I have very many Ray tasks or actors.
ray.worker.global_worker.run_function_on_all_workers seemed promising but looks like it is on the deprecation path now. Any other ideas or tips?