Skip to content

Can onNext may be signalled before onSubscribe returns? #555

Open
@onacit

Description

@onacit

Can the subscriber.onNext(item) be invoked before the subscriber.onSubscribe(subscription) returns, e.g. the subscriber invokes subscription.request(n) within the onSubscribe(subscription) method?

void onSubscribe(Subscription subscription) {
    subscription.request(1);
    // the publisher may start (asynchronously) publishing items to the subscriber
    // which means the onNext(item) may be invoked before this method returns
    log.debug("end-of-on-subscribe");
}

void onNext(T item) {
    log.debug("next");
}

(If logging is synchronized,)
Can next be logged before the end-of-on-subscribe?

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