Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a cold TestPublisher #1236

Closed
simonbasle opened this issue Jun 11, 2018 · 1 comment
Closed

Add a cold TestPublisher #1236

simonbasle opened this issue Jun 11, 2018 · 1 comment
Assignees
Labels
area/reactor-test This belongs to the reactor-test module type/enhancement A general enhancement
Milestone

Comments

@simonbasle
Copy link
Member

Expected behavior

TestPublisher<String> result = TestPublisher.create();

assertThat(result.next("value").mono().block()).isEqualTo("value");

Actual behavior

Resolves to null, because by the time the block() is called, the DefaultTestPublisher is already terminated: it had no subscribers when calling next, so it only replays the terminal signal to subsequent subscribers.

Resolution

We need a "cold" implementation of TestPublisher that will replay a sequence to all its Subscribers. Possibly, let the user add signals (via next) or change the termination signal (via error() or complete()) between 2 subscriptions. In that case however, change should only impact the next new subscriber (ie. the publish methods don't impact current subscribers at all).

Reactor Core version

3.1.8+

@simonbasle simonbasle added type/enhancement A general enhancement area/reactor-test This belongs to the reactor-test module labels Jun 11, 2018
@simonbasle simonbasle added this to the Backlog milestone Jun 11, 2018
@simonbasle simonbasle self-assigned this Jun 11, 2018
@simonbasle
Copy link
Member Author

cc @rwinch does it sound like what you need?

simonbasle added a commit that referenced this issue Jun 11, 2018
simonbasle added a commit that referenced this issue Jun 11, 2018
This commit also clarifies that other TestPpublisher flavours are hot.
@simonbasle simonbasle modified the milestones: Backlog, 3.2.0.M2 Jun 13, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/reactor-test This belongs to the reactor-test module type/enhancement A general enhancement
Projects
None yet
Development

No branches or pull requests

1 participant