Hi! I created a custom PriorityQueue…based off of ray.util.queue.Queue
. Like Ray’s Queue, PriorityQueue uses an Actor to wrap an asyncio.PriorityQueue
.
I’m working on a realtime app that frequently polls the qsize. This essentially spams remote calls to the PriorityQueueActor…which eventually overloads the Ray cluster & maxes out my CPU usage.
I’d like a reactive signal for qsize that will notify the caller whenever qsize changes. This would significantly reduce the number of remote calls. Since a remote call would occur when qsize changes, instead of n clients polling every ~1ms.
Are there available examples or patterns that implement reactivity with Ray actors? Where updates to the state notify the remote listeners. And each remote listener caches the state in it’s local process.
Callbacks would work. However all of the Callback examples I found relate to ray.tune
…which I’m not using.
I see rayvens, which could work. It seems a bit heavy for my needs but I’ll give it try. I hope there’s a lightweight way to do this without adding another dependency.
Thank you,
Brian
I see that a Ray Actor can be an AsyncIterator
. I think this will work. Where the a change to the state yields the new state.