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

Class _ActorMethodOptionsWrapper

python/ray/actor.py:1153–1171  ·  view source on GitHub ↗

Wraps an ActorMethod with pre-set options for .remote() and .bind(). Defined at module scope to avoid the reference cycle that occurs when a class is defined inside a closure (CPython's implicit __class__ cell keeps the closure alive, which keeps the ActorMethod and its ActorHandle aliv

Source from the content-addressed store, hash-verified

1151
1152
1153class _ActorMethodOptionsWrapper:
1154 """Wraps an ActorMethod with pre-set options for .remote() and .bind().
1155
1156 Defined at module scope to avoid the reference cycle that occurs when a
1157 class is defined inside a closure (CPython's implicit __class__ cell keeps
1158 the closure alive, which keeps the ActorMethod and its ActorHandle alive).
1159 See https://github.com/ray-project/ray/issues/61922.
1160 """
1161
1162 def __init__(self, actor_method, options):
1163 self._actor_method = actor_method
1164 self._options = options
1165
1166 def remote(self, *args, **kwargs):
1167 return self._actor_method._remote(args=args, kwargs=kwargs, **self._options)
1168
1169 @DeveloperAPI
1170 def bind(self, *args, **kwargs):
1171 return self._actor_method._bind(args=args, kwargs=kwargs, **self._options)
1172
1173
1174class _ActorClassMethodMetadata(object):

Callers 1

optionsMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…