Skip to content

Equivalent of PublishOn, SubscribeOn, Work-Stealing/Drain-loop, Scheduler - Controlling which thread callback runs on #127

@hutchig

Description

@hutchig

When looking at the issue of multiple Subscribers a topic that came up was
a nested

onNext(
   onNext(
      onNext(

stack.

Problem: As onNext cannot be called more than once there is only one data payload traversing the stream.

However the 'obvious' solution is for onNext to return early having kicked off
some concurrent work on a different thread to complete a CompletionStage when
done.

A downside of this is that a payload will switch threads as it moves through each
onData layer (as onNext has to return the calling thread to the caller).

See https://youtu.be/hfupNIxzNP4?t=1872 for intro.

To get the best of both worlds we need the ability to influence the thread used
for the processing of a stage.

I am not sure what milestone this is best done for but wanted a place (here) to discuss.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions