Skip to content

TestSubject event scheduling works differently than specified in its javadoc #1759

Closed

Description

@akarnokd

The javadoc indicates that using the onNext(T value, long timeInMilliseconds) and the other methods will schedule an event emission to the specified absolute time, but the code schedules the emission relative to the underlying scheduler's now() value. This only works as expected when using with the TestScheduler at time 0. I don't see any uses of this class and suggest removing it completely to avoid confusion.

Activity

  1. zsxwing commented on Oct 15, 2014

    @zsxwing
    Member

    +1 for removing TestSubject

  2. benjchristensen commented on Oct 15, 2014

    @benjchristensen
    Member

    I have used it in the Turbine project with success.

    Help me confirm the confusion, is it because it has both onNext(T) and onNext(T, timeInMilliseconds)?

    If that's why then yes I can see why it's confusing. It works, but only if you know how to use it.

    Here is an examples of me using it: https://github.com/Netflix/Turbine/blob/22246ce26d812813e2a242d2f42cfc432a45a8b2/turbine-core/src/test/java/com/netflix/turbine/aggregator/StreamAggregatorTest.java#L604

  3. benjchristensen commented on Oct 15, 2014

    @benjchristensen
    Member

    @headinthebox Do you have an opinion on keeping or removing this? I'm okay removing it due to its confusion.

  4. added a commit that references this issue on Oct 24, 2014
  5. benjchristensen commented on Oct 24, 2014

    @benjchristensen
    Member

    Added docs in #1796 while reviewing with @headinthebox

  6. added this to the 1.0 milestone on Oct 24, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions