I'm playing with flow and trying to integrate it w...
# coroutines
j
I'm playing with flow and trying to integrate it with RabbitMQ. But I'm running into an issue where I can't emit values to a flow. I've created a simple example of my problem as shown on the image below. How would I solve this issue? If I try to run it in some other coroutine, Flow will just throw an error with the message
Emission from another coroutine is detected.
l
You want to use
callbackFlow
, BTW, make sure to look at its doc and to support cancellation properly.
🤩 1
j
Thanks, this is exactly what I need 🙂