mirror of
https://github.com/wassname/ray.git
synced 2026-07-06 05:16:30 +08:00
Change Python's ObjectID to ObjectRef (#9353)
This commit is contained in:
@@ -21,7 +21,7 @@ from ray.includes.unique_ids cimport (
|
||||
from ray._raylet cimport (
|
||||
Buffer,
|
||||
ActorID,
|
||||
ObjectID,
|
||||
ObjectRef,
|
||||
FunctionDescriptor,
|
||||
)
|
||||
|
||||
@@ -49,7 +49,7 @@ channel_logger = logging.getLogger(__name__)
|
||||
cdef class ChannelCreationParameter:
|
||||
cdef:
|
||||
CChannelCreationParameter parameter
|
||||
|
||||
|
||||
def __cinit__(self, ActorID actor_id, FunctionDescriptor async_func, FunctionDescriptor sync_func):
|
||||
cdef:
|
||||
shared_ptr[CRayFunction] async_func_ptr
|
||||
@@ -190,7 +190,7 @@ cdef class DataWriter:
|
||||
channel_logger.info("deleted DataWriter")
|
||||
self.writer = NULL
|
||||
|
||||
def write(self, ObjectID qid, const unsigned char[:] value):
|
||||
def write(self, ObjectRef qid, const unsigned char[:] value):
|
||||
"""support zero-copy bytes, bytearray, array of unsigned char"""
|
||||
cdef:
|
||||
CObjectID native_id = qid.data
|
||||
@@ -322,4 +322,4 @@ cdef c_vector[c_string] qid_vector_to_list(c_vector[CObjectID] queue_id_vec):
|
||||
queues = []
|
||||
for obj_id in queue_id_vec:
|
||||
queues.append(obj_id.Binary())
|
||||
return queues
|
||||
return queues
|
||||
|
||||
@@ -27,7 +27,8 @@ class ChannelID:
|
||||
channel_id_str: string representation of channel id
|
||||
"""
|
||||
self.channel_id_str = channel_id_str
|
||||
self.object_qid = ray.ObjectID(channel_id_str_to_bytes(channel_id_str))
|
||||
self.object_qid = ray.ObjectRef(
|
||||
channel_id_str_to_bytes(channel_id_str))
|
||||
|
||||
def __eq__(self, other):
|
||||
if other is None:
|
||||
|
||||
Reference in New Issue
Block a user