Call stack length and EventLoopScheduler
When developing PHP applications, it's handy to enable the Xdebug extension that we can use to debug our code. However this comes with the cost of reduced performance, higher memory usage, and a limited number of possible nested function calls.
The last issue is relevant to us in particular. For example, in RxPHP when we make a long operator chain and use the ImmediateScheduler
method. Consider the following very long chain of operators:
// stack_length_01.php Observable::range(1, 10) ->doOnNext(function($val) { /* do whatever */ }) ->startWithArray([12, 15, 17]) ->skip(1) ->map(function($val) { return $val * 2; }) ->filter(function($val) { return $val % 3 === 0; }) ->doOnNext(function($val) { /* do whatever */ }) ->takeLast(3) ->sum() ->doOnNext(function($val) { /* do whatever */ }) ->subscribe(new...