Skip to content

4.x: Streamable +collect +blocking +withCancel - #8333

Merged
akarnokd merged 1 commit into
ReactiveX:4.xfrom
akarnokd:4xStreamableOps1015a
Oct 15, 2026
Merged

akarnokd merged 1 commit into
ReactiveX:4.xfrom
akarnokd:4xStreamableOps1015a

Conversation

@akarnokd

@akarnokd akarnokd commented Oct 15, 2026 •

Copy link
Copy Markdown
Member

Implement more operators

  • blockingFirst(T) and blockingFirst(T, StreamerCancellation) - get the first item or return the default item.
  • blockingLast(T) and blockingLast(T, StreamerCancellation) - get the last item or return the default item.
  • collect(Supplier, BiConsumer) - collect with explicit supplier and biconsumer callbacks.
  • error(Supplier) - generate the error when streaming.
  • withCancellation(StreamerCancellation) + 1. Allows injecting a cancellation opportunity into the flow.

Bugfix

  • Fix a NPE crash when running a DeferredEnumerableSource with collect and a failing source.

Cleanup

  • Organize imports
  • Suppress resource warnings in unit tests.

Related

#8299

@github-actions

Copy link
Copy Markdown

🐷 TruffleHog + Entropy Beauty Scan

Average entropy of changed code: 4.652 bits/char
Verdict: ✅ Mid-4 beauty detected (thoughtful human code!)

Changed files entropy:

src/main/java/io/reactivex/rxjava4/core/Streamable.java: 4.648
src/main/java/io/reactivex/rxjava4/internal/operators/streamable/StreamableBlocking.java: 4.550
src/main/java/io/reactivex/rxjava4/internal/operators/streamable/StreamableCollect.java: 3.973
src/main/java/io/reactivex/rxjava4/internal/operators/streamable/StreamableCollector.java: 4.042
src/main/java/io/reactivex/rxjava4/internal/operators/streamable/StreamableWithCancellation.java: 4.847
src/test/java/io/reactivex/rxjava4/internal/operators/maybe/MaybeAmbTest.java: 4.633
src/test/java/io/reactivex/rxjava4/internal/operators/streamable/StreamableBlockingFirstTest.java: 4.935
src/test/java/io/reactivex/rxjava4/internal/operators/streamable/StreamableBlockingLastTest.java: 4.917
src/test/java/io/reactivex/rxjava4/internal/operators/streamable/StreamableCollectTest.java: 4.760
src/test/java/io/reactivex/rxjava4/internal/operators/streamable/StreamableCollectorTest.java: 4.767
src/test/java/io/reactivex/rxjava4/internal/operators/streamable/StreamableErrorTest.java: 4.772
src/test/java/io/reactivex/rxjava4/internal/operators/streamable/StreamableWithCancellationTest.java: 4.884
src/test/java/io/reactivex/rxjava4/internal/schedulers/SchedulerToExecutorServiceTest.java: 4.751

✅ No secrets or suspicious high-entropy strings found.

Mid-4 beauty heuristic in action — powered by our entropy chats! 😊

@codecov

codecov Bot commented Oct 15, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 97.94521% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 98.61%. Comparing base (798dc01) to head (74599a3).

Files with missing lines Patch % Lines
...ternal/operators/streamable/StreamableCollect.java 97.34% 1 Missing and 2 partials ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##                4.x    #8333      +/-   ##
============================================
- Coverage     98.63%   98.61%   -0.03%     
- Complexity     7157     7170      +13     
============================================
  Files           824      826       +2     
  Lines         50832    50972     +140     
  Branches       6920     6944      +24     
============================================
+ Hits          50139    50266     +127     
- Misses          473      479       +6     
- Partials        220      227       +7     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@akarnokd
akarnokd merged commit a4f2af4 into ReactiveX:4.x Oct 15, 2026
8 checks passed
@akarnokd
akarnokd deleted the 4xStreamableOps1015a branch October 15, 2026 11:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant