Skip to content

fix: windowwithtimeorcount thread unsafe#700

Open
fanck0605 wants to merge 1 commit intoReactiveX:masterfrom
fanck0605:patch-1
Open

fix: windowwithtimeorcount thread unsafe#700
fanck0605 wants to merge 1 commit intoReactiveX:masterfrom
fanck0605:patch-1

Conversation

@fanck0605
Copy link

@fanck0605 fanck0605 commented Sep 18, 2023

We expect them to be equal, but they are not

result = []
(
    reactivex.range(100_000)
    .pipe(
        operators.buffer_with_time_or_count(timespan=0.001, count=10_000),
    )
    .subscribe(on_next=lambda x: result.extend(x))
)
print(f"len(result) = {len(result)}")
assert result == [*range(100_000)]

Result:

len(result) = 99986
Traceback (most recent call last):
  File "D:\Projects\效能提升\rxdemo\test_retry.py", line 16, in <module>
    assert result == [*range(100_000)]
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant