Skip to content

Add async stream interfaces#51

Open
haeseoklee wants to merge 3 commits into
uber:mainfrom
haeseoklee:add-async-stream-interfaces
Open

Add async stream interfaces#51
haeseoklee wants to merge 3 commits into
uber:mainfrom
haeseoklee:add-async-stream-interfaces

Conversation

@haeseoklee
Copy link
Copy Markdown

@haeseoklee haeseoklee commented May 20, 2026

Summary

Add Swift Concurrency-friendly interfaces on top of the existing RxSwift-based RIBs APIs.

This change keeps RxSwift as the source of truth and adds additive async/await conveniences for observing lifecycle streams, consuming workflow step outputs, confining async sequences to RIB lifecycle, and binding Swift Tasks to existing RIB lifecycle scopes.

Changes

  • Add Observable to async sequence bridges:

    • ObservableType.asAsyncStream(...)
    • ObservableType.asAsyncThrowingStream(...)
  • Add async lifecycle stream conveniences:

    • InteractorScope.isActiveSequence
    • RouterScope.lifecycleSequence
    • Working.isStartedSequence
    • LeakDetector.statusSequence
  • Add Workflow async APIs:

    • Step.asAsyncSequence(...)
    • Step.onAsyncStep(...)
    • AsyncSequence.fork(_:)
  • Add lifecycle-scoped task helpers:

    • Interactor.taskOnDeactivate(...)
    • Interactor.throwingTaskOnDeactivate(...)
    • Worker.taskOnStop(...)
    • Worker.throwingTaskOnStop(...)
    • Workflow.task(...)
    • Workflow.throwingTask(...)
  • Add async sequence lifecycle confinement:

    • AsyncSequence.confineTo(_:)
    • Uses swift-async-algorithms combineLatest instead of manually implementing combineLatest behavior
    • Adds AnyAsyncSequence<Element> to preserve element type information without requiring typed AsyncSequence<Element, Failure> availability
  • Add swift-async-algorithms as a SwiftPM dependency.

  • Add tests covering

Notes

The async APIs are added via extensions so existing protocol conformers and mocks remain source-compatible.

RxSwift remains the internal runtime for lifecycle and workflow behavior. The async interfaces bridge from the existing observable streams and disposable lifecycle hooks rather than replacing them.

Close #6

@CLAassistant
Copy link
Copy Markdown

CLAassistant commented May 20, 2026

CLA assistant check
All committers have signed the CLA.

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.

Modernization: Add conveniences around async/await

2 participants