MCPcopy
hub / github.com/ray-project/ray / remote

Method remote

python/ray/util/client/api.py:76–101  ·  view source on GitHub ↗

remote is the hook stub passed on to replace `ray.remote`. This sets up remote functions or actors, as the decorator, but does not execute them. Args: *args: opaque arguments; when used as ``@ray.remote`` with no parentheses, contains the wrapped

(self, *args: Any, **kwargs: Any)

Source from the content-addressed store, hash-verified

74 return self.worker.wait(*args, **kwargs)
75
76 def remote(self, *args: Any, **kwargs: Any):
77 """remote is the hook stub passed on to replace `ray.remote`.
78
79 This sets up remote functions or actors, as the decorator,
80 but does not execute them.
81
82 Args:
83 *args: opaque arguments; when used as ``@ray.remote`` with no
84 parentheses, contains the wrapped function or class.
85 **kwargs: opaque keyword arguments; the options forwarded to
86 ``ray.remote(...)``.
87
88 Returns:
89 A client-side stub for the remote function or actor, or a
90 decorator that produces one when applied.
91 """
92 # Delayed import to avoid a cyclic import
93 from ray.util.client.common import remote_decorator
94
95 if len(args) == 1 and len(kwargs) == 0 and callable(args[0]):
96 # This is the case where the decorator is just @ray.remote.
97 return remote_decorator(options=None)(args[0])
98 assert (
99 len(args) == 0 and len(kwargs) > 0
100 ), ray_option_utils.remote_args_error_string
101 return remote_decorator(options=kwargs)
102
103 # TODO(mwtian): consider adding _internal_ prefix to call_remote /
104 # call_release / call_retain.

Callers 15

test_basic_scalingFunction · 0.45
gFunction · 0.45
test_idle_node_blockedFunction · 0.45
test_get_cluster_statusFunction · 0.45
__init__Method · 0.45
get_asyncMethod · 0.45
multigetMethod · 0.45

Calls 1

remote_decoratorFunction · 0.90

Tested by 15

test_basic_scalingFunction · 0.36
gFunction · 0.36
test_idle_node_blockedFunction · 0.36
test_get_cluster_statusFunction · 0.36
__call__Method · 0.36