mirror of
https://github.com/wassname/ray.git
synced 2026-07-03 10:02:15 +08:00
Handle exchange of direct call objects between tasks and actors (#6147)
This commit is contained in:
@@ -104,6 +104,7 @@ cdef extern from "ray/core_worker/core_worker.h" nogil:
|
||||
*bytes)
|
||||
void AddObjectIDReference(const CObjectID &object_id)
|
||||
void RemoveObjectIDReference(const CObjectID &object_id)
|
||||
void PromoteObjectToPlasma(const CObjectID &object_id)
|
||||
|
||||
CRayStatus SetClientOptions(c_string client_name, int64_t limit)
|
||||
CRayStatus Put(const CRayObject &object, CObjectID *object_id)
|
||||
|
||||
@@ -95,8 +95,10 @@ cdef class TaskSpec:
|
||||
:self.task_spec.get().ArgMetadataSize(i)]
|
||||
if metadata == RAW_BUFFER_METADATA:
|
||||
obj = data
|
||||
else:
|
||||
elif metadata == PICKLE_BUFFER_METADATA:
|
||||
obj = pickle.loads(data)
|
||||
else:
|
||||
obj = data
|
||||
arg_list.append(obj)
|
||||
elif lang == <int32_t>LANGUAGE_JAVA:
|
||||
arg_list = num_args * ["<java-argument>"]
|
||||
|
||||
@@ -150,6 +150,8 @@ cdef extern from "ray/common/id.h" namespace "ray" nogil:
|
||||
|
||||
c_bool IsDirectCallType()
|
||||
|
||||
CObjectID WithPlasmaTransportType()
|
||||
|
||||
int64_t ObjectIndex() const
|
||||
|
||||
CTaskID TaskId() const
|
||||
|
||||
@@ -179,6 +179,9 @@ cdef class ObjectID(BaseID):
|
||||
def is_direct_call_type(self):
|
||||
return self.data.IsDirectCallType()
|
||||
|
||||
def with_plasma_transport_type(self):
|
||||
return ObjectID(self.data.WithPlasmaTransportType().Binary())
|
||||
|
||||
def is_nil(self):
|
||||
return self.data.IsNil()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user