Skip to content

PublishSubject is broken? #1180

Closed
Closed
@andrask

Description

@andrask

Can I ask someone to explain me why this code terminates without writing out anything?

PublishSubject<String> s = PublishSubject.create();

Subscription subscribe = s.replay(1).doOnNext(new Action1<String>() {
    @Override
    public void call(String t1) {
        System.out.println(t1);
    }

}).subscribe();

s.onNext("hello");

While debugging, I see that the subject has no subscribers. True, there are no direct subscribers but the replay() creates a multicast connection.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions