Request for clarification for Scheduler.Worker JavaDoc
On 1.x, currently the JavaDoc states the following on Scheduler.Worker:
/**
* Retrieves or creates a new {@link Scheduler.Worker} that represents serial execution of actions.
* <p>
* When work is completed it should be unsubscribed using {@link Scheduler.Worker#unsubscribe()}.
* <p>
* Work on a {@link Scheduler.Worker} is guaranteed to be sequential.
*
* @return a Worker representing a serial queue of actions to be executed
*/
I think the confusing part is deciding exactly what is going to be sequential. For me, based on this description it appeared that submitted Worker Actions will be executed sequentially, without any parallel execution within a Worker instance. This is apparently not the case with most current Workers looking into their implementation (e.g. NewThreadScheduler).
I'm happy to submit a PR with a more specific description, just wanted to make sure that you guys also see this problematic.
Here are two other javadocs for comparison:
https://github.com/reactor/reactive-streams-commons/blob/master/src/main/java/rsc/scheduler/Scheduler.java
https://github.com/reactor/reactive-streams-commons/blob/master/src/main/java/rsc/scheduler/TimedScheduler.java
RxJava workers guarantee FIFO order for non-timed task and some order between timed tasks, but tasks never run concurrently with each other on the same worker no matter what the underlying threading model is. For example, this is guaranteed in NewThreadWorker because it uses a single-threaded ScheduledExecutorService. For ExecutorScheduler, the FIFO nature is ensured by additional trampolining.
Fair point, the pieces clicked together now - thanks for the clarification!