Skip to content

FluxPublishOn to detach itself after further requests #3954

@MikkelHJuul

Description

@MikkelHJuul

The FluxPublishOnSubscriber#runAsync will never escape its infinite loop if the call to onNext take longer time than the period between events from upstream.

This makes it so that the thread will never stop looping. And it has the unfortunate effect that; for a Scheduler of pool size N. If M (greater than N) upstream fluxes #publishOn that scheduler, only N of those fluxes will be subscribed and worked on.

While upstream supply is available I would prefer even distribution across all fluxes.

I suggest adding a flag to the publishOn that would allow control that the loop escape after requesting, or performing the request in the scheduler itself. This would free up the thread to pick up other tasks from the taskqueue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions