Execution of Runnables in Dispatcher

51 views
Skip to first unread message

Luciano Leggieri

unread,
Apr 15, 2014, 11:52:42 PM4/15/14
to reactor-...@googlegroups.com
In RingBufferDispatcher (and similarly in WorkQueueDispatcher), there is the following code:

public void execute(final Runnable command) {
ringBuffer.publishEvent(new EventTranslator<RingBufferTask>() {
@Override
public void translateTo(RingBufferTask event, long sequence) {
command.run();
}
});
}

debugging it, I realized that command.run() is executed in the calling thread (so, it's synchronous). This is because publishEvent calls transtateTo.
I was wondering if this is the expected behaviour. Shouldn't it be something like executor.execute(command), or executor.submit(command)?

Cheers!

Jon Brisbin

unread,
Apr 16, 2014, 10:00:18 AM4/16/14
to Luciano Leggieri, reactor-...@googlegroups.com
Thanks for the catch! :)

I'm pushing a fix right now (well, the tests are running at the moment :) and am preparing to do an RC1 release so this fix should show up in that.


Thanks!

Jon Brisbin | Reactor Project Lead

--
You received this message because you are subscribed to the Google Groups "reactor-framework" group.
To unsubscribe from this group and stop receiving emails from it, send an email to reactor-framew...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Luciano Leggieri

unread,
Apr 17, 2014, 12:55:37 AM4/17/14
to reactor-...@googlegroups.com, Luciano Leggieri
Thanks to you! Also, if Reactor-Spring targets Spring 4, could you make AbstractAsyncTaskExecutor extend AsyncListenableTaskExecutor instead of just AsyncTaskExecutor ? :)

Jon Brisbin

unread,
Apr 28, 2014, 11:09:58 AM4/28/14
to Luciano Leggieri, reactor-...@googlegroups.com
FYI I just released reactor-spring-core 1.1.0.RC1. TaskExecutors are now AsyncListenableTaskExecutors.

1.1.0.RELEASE is planned for sometime Tuesday.


Thanks!

Jon Brisbin | Reactor Project Lead

Luciano Leggieri

unread,
Apr 30, 2014, 10:11:39 PM4/30/14
to reactor-...@googlegroups.com, Luciano Leggieri
Thank you. I've already updated my project to 1.1.0.RELEASE :-)
Reply all
Reply to author
Forward
0 new messages