Support multiple core workers in one process (#7623)

This commit is contained in:
Kai Yang
2020-04-07 11:01:47 +08:00
committed by GitHub
parent e91595f955
commit 48b48cc8c2
90 changed files with 2014 additions and 1411 deletions
+2 -9
View File
@@ -19,14 +19,11 @@ from ray.includes.unique_ids cimport (
)
from ray._raylet cimport (
Buffer,
CoreWorker,
ActorID,
ObjectID,
FunctionDescriptor,
)
from ray.includes.libcoreworker cimport CCoreWorker
cimport ray.streaming.includes.libstreaming as libstreaming
from ray.streaming.includes.libstreaming cimport (
CStreamingStatus,
@@ -52,16 +49,14 @@ cdef class ReaderClient:
CReaderClient *client
def __cinit__(self,
CoreWorker worker,
FunctionDescriptor async_func,
FunctionDescriptor sync_func):
cdef:
CCoreWorker *core_worker = worker.core_worker.get()
CRayFunction async_native_func
CRayFunction sync_native_func
async_native_func = CRayFunction(LANGUAGE_PYTHON, async_func.descriptor)
sync_native_func = CRayFunction(LANGUAGE_PYTHON, sync_func.descriptor)
self.client = new CReaderClient(core_worker, async_native_func, sync_native_func)
self.client = new CReaderClient(async_native_func, sync_native_func)
def __dealloc__(self):
del self.client
@@ -91,16 +86,14 @@ cdef class WriterClient:
CWriterClient * client
def __cinit__(self,
CoreWorker worker,
FunctionDescriptor async_func,
FunctionDescriptor sync_func):
cdef:
CCoreWorker *core_worker = worker.core_worker.get()
CRayFunction async_native_func
CRayFunction sync_native_func
async_native_func = CRayFunction(LANGUAGE_PYTHON, async_func.descriptor)
sync_native_func = CRayFunction(LANGUAGE_PYTHON, sync_func.descriptor)
self.client = new CWriterClient(core_worker, async_native_func, sync_native_func)
self.client = new CWriterClient(async_native_func, sync_native_func)
def __dealloc__(self):
del self.client