mirror of
https://github.com/wassname/ray.git
synced 2026-06-28 07:02:22 +08:00
Remove serialized from_random object ids in tests (#7340)
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
import asyncio
|
||||
import json
|
||||
import fnmatch
|
||||
import os
|
||||
@@ -210,3 +211,27 @@ def generate_internal_config_map(**kwargs):
|
||||
"_internal_config": internal_config,
|
||||
}
|
||||
return ray_kwargs
|
||||
|
||||
|
||||
@ray.remote(num_cpus=0)
|
||||
class SignalActor:
|
||||
def __init__(self):
|
||||
self.ready_event = asyncio.Event()
|
||||
|
||||
def send(self):
|
||||
self.ready_event.set()
|
||||
|
||||
async def wait(self, should_wait=True):
|
||||
if should_wait:
|
||||
await self.ready_event.wait()
|
||||
|
||||
|
||||
class RemoteSignal:
|
||||
def __init__(self):
|
||||
self.signal_actor = SignalActor.remote()
|
||||
|
||||
def send(self):
|
||||
ray.get(self.signal_actor.send.remote())
|
||||
|
||||
def wait(self):
|
||||
ray.get(self.signal_actor.wait.remote())
|
||||
|
||||
Reference in New Issue
Block a user