EventMachine & EM.defer

W

William F.

I'm stuck using EM.defer.

I am trying to use EM.defer simply to thread a bunch of processing for
now (more complicated plans, but this is the problem so the use case is
simplified). I have it deferring and threading, but not calling back
successfully (to the main loop) and ending the reactor loop. What am I
doing wrong? All code, and sample command line output in this pastie.
Should be easy for someone with EM experience to troubleshoot.. help?

http://pastie.org/1477454
 
B

Bryan Richardson

Hello,

I'm on my phone right now so I can't try your code nor can I even read
it very clearly.

However, I just wanted to point out a problem I encountered when I
first used Deferrable that may or may not help.

Each time Deferrable#success or Deferrable#failure is called, all the
callbacks/errbacks are called AND THEN DESTROYED. Thus, your callbacks
may only get executed once unless they are somehow added to the
Deferrable object again.

My way around this was to use a Channel instead of success/callback.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,050
Latest member
AngelS122

Latest Threads

Top