2 ms·
This article is interesting, but as a beginner to both Ruby and the actor model I'm left with some questions that limit my confidence in what I've learned. Whe
by nerdponx 4y ago
This article is interesting, but as a beginner to both Ruby and the actor model I'm left with some questions that limit my confidence in what I've learned.
When exactly can you send to or receive from a ractor? Are you expected to wrap every send and receive in some kind of error handler, or can you at least check with some "is_closed" method? When exactly do ports open and close, and how long do they stay open for?
- pmontra 4y agoPorts open when the ractor is created and close when the ractor ends (when its code terminates.) You can send to any ractor you have in scope and receive if the ractor sent a reply (or you'll stand still and wait.) No exception wrapping is required but try to receive from a terminated ractor and see what happens.