Skip to content

replay doesn't replay #412

@nikobarli

Description

@nikobarli

Hi,

the operator replay seems not able to serve more than one subscription. The output of the following code

        auto cob = rxcpp::rxs::from(1, 2, 3)
            .tap([](int v) {cout << "tap: " << v << endl; })
            .replay()
            .ref_count()
            ;
        cob.subscribe([](int v) {cout << "subscribe A: " << v << endl; });
        cob.subscribe([](int v) {cout << "subscribe B: " << v << endl; });

is like this

tap: 1
subscribe A: 1
tap: 2
subscribe A: 2
tap: 3
subscribe A: 3

I.e. The second subscription is never called.

Running similar code using Rx.NET outputs the followings:

tap: 1
subscribe A: 1
tap: 2
subscribe A: 2
tap: 3
subscribe A: 3
subscribe B: 1
subscribe B: 2
subscribe B: 3

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