mirror of
https://github.com/wassname/ray.git
synced 2026-07-07 19:41:45 +08:00
Ref count objects created with ray.put (#5590)
* wip * add weakref option * tune util * test ref * doc * fix tests
This commit is contained in:
@@ -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()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user