1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
# @ray.remote
# class Actor:
# def show_namespace(self):
# print("namespace: ", ray.get_runtime_context().get_actor_namespace())
# # Create an actor with specified namespace.
# actor = Actor.options(
# name="my_actor",
# namespace="actor_namespace", # <- specify namespace here
# lifetime="detached"
# ).remote()
# ray.get(actor.show_namespace.remote())
# The Output
# >>> (Actor pid=30522) namespace: 540bbea1-bc1c-4ec3-8447-a858958151ce
return f
=
# raises RayActorError
# print(ray.get(a.ping.remote("no retries")))
# raises RayActorError
# ok
# print(ray.get(a.ping.options(max_task_retries=-1).remote("task retries")))
# max_task_retries = 3 raises, = 4 is ok