How to use future to turn a message queue based asynchronous call into synchronous?

25 views
Skip to first unread message

Elf Qi

unread,
Sep 9, 2016, 6:24:48 AM9/9/16
to Celluloid
Dear all,

  I am using Celluloid with AWS SQS and I need to send a message to a queue and receive the response message. I found the Celluloid::Condition could be helpful but it may cause deadlock as mentioned on the wiki. Can I use Future to solve this problem?

 If not, I need a timeout on the wait method, but when the message finally arrived I need a way to figure out if the timeout occurred. Could you let me the method to check the timeout status (similar to Thread.interrupted() in Java) and does the wait method throw and Interrupted exception when timeouts?

Thank you in advance
Reply all
Reply to author
Forward
0 new messages