mirror of
https://github.com/wassname/ray.git
synced 2026-08-03 13:10:57 +08:00
[xray] Basic actor support (#1835)
This commit is contained in:
committed by
Robert Nishihara
parent
313b864e66
commit
bf194db4bc
@@ -47,3 +47,18 @@ def test_basic_task_api(ray_start):
|
||||
# Test arguments passed by ID.
|
||||
|
||||
# Test keyword arguments.
|
||||
|
||||
|
||||
def test_actor_api(ray_start):
|
||||
|
||||
@ray.remote
|
||||
class Foo(object):
|
||||
def __init__(self, val):
|
||||
self.x = val
|
||||
|
||||
def get(self):
|
||||
return self.x
|
||||
|
||||
x = 1
|
||||
f = Foo.remote(x)
|
||||
assert (ray.get(f.get.remote()) == x)
|
||||
|
||||
Reference in New Issue
Block a user