Replies: 4 comments
-
It appears to work fine for me on Ruby 3. |
Beta Was this translation helpful? Give feedback.
-
@ioquatix Just checked, this is output in Ruby 2.7.2:
|
Beta Was this translation helpful? Give feedback.
-
@ioquatix, so am I using Async in proper way? Does a problem above belong to Async or Ruby? |
Beta Was this translation helpful? Give feedback.
-
Ruby 3.0 exposes hooks for blocking operations and Async can handle them. If you want to write something which is based on async, use In other words, if you use thread primitives with async on Ruby 2, you will block the reactor. |
Beta Was this translation helpful? Give feedback.
-
I wrote a simple demo producer-consumer using Thread(s) and Queue and it works.
Then I rewrote it using Async, it fails due to deadlock. Tried to use
Async::Reactor
insteadwhile
loop and no luck.Can you advise how to fix it?
Beta Was this translation helpful? Give feedback.
All reactions