GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Observable#window(long, java.util.concurrent.TimeUnit, long) if reached "window-max-count", the timespan not work · Issue #6651 · ReactiveX/RxJava

Observable#window(long, java.util.concurrent.TimeUnit, long) if reached "window-max-count", the timespan not work #6651

New issue
Copy link
New issue
Copy link
Closed
#6652
Closed
Observable#window(long, java.util.concurrent.TimeUnit, long) if reached "window-max-count", the timespan not work#6651
#6652
Copy link
Labels
2.x3.xBug
Milestone
3.0

Description

@chxchen
chxchen
opened on Sep 12, 2019
Issue body actions

io.reactivex.Observable#window(long, java.util.concurrent.TimeUnit, long)

Observable.create((ObservableOnSubscribe<Integer>) emitter -> {
            emitter.onNext(0);
            emitter.onNext(1);
            TimeUnit.SECONDS.sleep(1);
            emitter.onNext(2);
            TimeUnit.SECONDS.sleep(6);
            emitter.onNext(4);
            emitter.onNext(5);
        })
                .subscribeOn(Schedulers.io())
                .observeOn(Schedulers.io())
                .window(5,TimeUnit.SECONDS, 2)
                .flatMapSingle(Observable::toList)
                .subscribe(list -> System.out.println("list=" + list + " time: "
                      + TimeUnit.MILLISECONDS.toSeconds(System.currentTimeMillis() - l)
                      + "s"));

Like the case of above, since 7 seconds, some empty arrays are expected,and "2" will be emited when the 5 seconds,but actually not.

list=[0, 1] time: 0s
list=[2, 4] time: 7s

There is nothing after 7 seconds, it make a confuse.
As the chart https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/window6.png
it says that the timeSpan still works after winow-max-size reached.

Activity

  1. akarnokd
    added
    2.x
    Question
    on Sep 12, 2019
  2. akarnokd commented on Sep 12, 2019

    @akarnokd
    akarnokd
    on Sep 12, 2019
    Member
    More actions

    How long did you wait for "5"? There is an overload where you can specify the time window should restart upon reaching the size limit.

  3. chxchen commented on Sep 12, 2019

    @chxchen
    chxchen
    on Sep 12, 2019
    Author
    More actions

    How long did you wait for "5"? There is an overload where you can specify the time window should restart upon reaching the size limit.

    never the "5" be passed, because createObservable does not emit a "complete" in this case of "restart" is false by default.
    if restart is true, the time window will restart, that is correct.

  4. akarnokd
    added
    Investigating
    3.x
    Bug
    and removed
    Question
    Investigating
    on Sep 12, 2019
  5. akarnokd
    added this to the 3.0 milestone on Sep 12, 2019
  6. akarnokd commented on Sep 12, 2019

    @akarnokd
    akarnokd
    on Sep 12, 2019
    Member
    More actions

    Thanks for the details, it is a bug in the operator. I'll post fixes shortly.

  7. chxchen commented on Sep 12, 2019

    @chxchen
    chxchen
    on Sep 12, 2019
    Author
    More actions

    Thanks for all of your contribution!

  8. akarnokd
    closed this as completedin #6652on Sep 17, 2019
  9. akarnokd commented on Sep 18, 2019

    @akarnokd
    akarnokd
    on Sep 18, 2019
    Member
    More actions

    Reopening to track 2.x

  10. akarnokd
    reopened this on Sep 18, 2019
  11. akarnokd commented on Sep 30, 2019

    @akarnokd
    akarnokd
    on Sep 30, 2019
    Member
    More actions

    Closing via #6657.

  12. akarnokd
    closed this as completedon Sep 30, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    2.x3.xBug

    Type

    No type

    Projects

    No projects

      Milestone

      • 3.0

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402775 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.