O'Reilly logo

Reactive Programming With Java 9 by Tejaswini Mandar Jog

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

The trampoline() operator

The trampoline() operator returns a default, shared an instance of the Scheduler which has a Scheduler.Worker instance queues the work and executes it in FIFO style. However, we cannot use it to reliably return the execution of the tasks to the current thread. The default implementation of the Scheduler executes the task on the current thread without any queuing, which adds time overload. The trampoline is a pattern in the functional programming. It facilitates the implementation of recursion without giving infinite calls for growing the stack. The idea behind it is to remove the current execution from the stack to eliminate the on-going stack. It manages to queue up the tasks one by one. The Scheduler starts with ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required