mirror of
https://github.com/wassname/ray.git
synced 2026-07-06 00:31:32 +08:00
Use Plasma with LRU refreshing integrated (#6050)
This commit is contained in:
@@ -72,7 +72,7 @@ async def _async_init():
|
||||
if handler is None:
|
||||
worker = ray.worker.global_worker
|
||||
plasma_client = thread_safe_client(
|
||||
plasma.connect(worker.node.plasma_store_socket_name, None, 0, 300))
|
||||
plasma.connect(worker.node.plasma_store_socket_name, 300))
|
||||
loop = asyncio.get_event_loop()
|
||||
plasma_client.subscribe()
|
||||
rsock = plasma_client.get_notification_socket()
|
||||
|
||||
@@ -39,7 +39,12 @@ class PlasmaProtocol(asyncio.Protocol):
|
||||
i += INT64_SIZE
|
||||
segment = self._buffer[i:i + msg_len]
|
||||
i += msg_len
|
||||
messages.append(self.plasma_client.decode_notification(segment))
|
||||
(object_ids, object_sizes,
|
||||
metadata_sizes) = self.plasma_client.decode_notifications(segment)
|
||||
assert len(object_ids) == len(object_sizes) == len(metadata_sizes)
|
||||
for j in range(len(object_ids)):
|
||||
messages.append((object_ids[j], object_sizes[j],
|
||||
metadata_sizes[j]))
|
||||
|
||||
self._buffer = self._buffer[i:]
|
||||
self.plasma_event_handler.process_notifications(messages)
|
||||
|
||||
Reference in New Issue
Block a user