Open ghost opened 11 years ago
Yes I agree.
The loop_delay
is used in an eventmachine timer to call the xenode's process()
method.
When a xenode first starts the EM timer is started and after the time has elapsed it will call process()
.
The process()
and process_message()
are blocking calls so if they are busy the eventmachine loop (and eventmachine timers) are blocked as well.
You can use include EM::Deferrable
to create an asynchronous xenode if you like. Em defferable info is here: http://eventmachine.rubyforge.org/docs/DEFERRABLES.html
Thanks for the info. For now I was trying to make sure it's not using the deferrable thing by default, and (not using) it is what I wanted, because I didn't want to find it executing process() while it was still inside process() from the last time and just build a tsunami like that
Yes a xenode is purposely not a deferrable so it doesn't trip up developers.
here: https://github.com/Nodally/xenograte-xct/wiki/xenode#nodebase-variables
loop-delay 5
for example means, it will delay 5 seconds afterprocess()
finished executing, (unless xenode was just started then it's 5 seconds afterstartup()
), that is: ifprocess()
takes 7 seconds to execute then after it finishes and +5 more seconds it will execute again. (tested)