MCPcopy Index your code
hub / github.com/ray-project/ray / __init__

Method __init__

python/ray/util/actor_pool.py:40–61  ·  view source on GitHub ↗
(self, actors: list)

Source from the content-addressed store, hash-verified

38 """
39
40 def __init__(self, actors: list):
41 from ray._common.usage.usage_lib import record_library_usage
42
43 record_library_usage("util.ActorPool")
44
45 # actors to be used
46 self._idle_actors = list(actors)
47
48 # get actor from future
49 self._future_to_actor = {}
50
51 # get future from index
52 self._index_to_future = {}
53
54 # next task to do
55 self._next_task_index = 0
56
57 # next task to return
58 self._next_return_index = 0
59
60 # next work depending when actors free
61 self._pending_submits = []
62
63 def map(self, fn: Callable[["ray.actor.ActorHandle", V], Any], values: List[V]):
64 """Apply the given function in parallel over the actors and values.

Callers

nothing calls this directly

Calls 2

record_library_usageFunction · 0.90
listFunction · 0.85

Tested by

no test coverage detected