If am using uvloop or asyncio, one of the features i am trying to explore is if i do some actions and then "await on a condition."
Let's look at the following example:
do_something()
zmq.send(stuff,coroutine_context)
rr = await (condition)
return rr
then some other process does some work.
then a coroutine on this process has:
rval = zmq.recv()
look at rval and get coroutine_context.
notify (condition) pass in rval.
Now i know i could use something like a condition variable but those require a lock of some kind. I do not care about multiple people accessing that coroutine so i don't want to 'lock' anything. I simply want to notify() that context with some data in this other coroutine (zmq coroutine) to return back to some element.
The key here is extracting the coroutine context (some id) to then notify the await command and pass in this rval item.
any ideas on how to do this efficiently without locks?