Ref count objects created with ray.put (#5590)

* wip

* add weakref option

* tune util

* test ref

* doc

* fix tests
This commit is contained in:
Eric Liang
2019-08-30 16:43:23 -07:00
committed by GitHub
parent 93e103135b
commit bea43c85b1
6 changed files with 77 additions and 23 deletions
+7
View File
@@ -130,6 +130,7 @@ cdef class UniqueID(BaseID):
cdef class ObjectID(BaseID):
cdef CObjectID data
cdef object buffer_ref
def __init__(self, id):
check_id(id)
@@ -153,6 +154,12 @@ cdef class ObjectID(BaseID):
def task_id(self):
return TaskID(self.data.TaskId().Binary())
def set_buffer_ref(self, ref):
self.buffer_ref = ref
def get_buffer_ref(self):
return self.buffer_ref
cdef size_t hash(self):
return self.data.Hash()