Skip to content

Enhancement: Offer support for AsyncSequence / AsyncStream #228

@ben-p-commits

Description

@ben-p-commits

Proposal: in addition to Combine, Document observation should have AsyncSequence + AsyncStream support.

Why?

  • Combine works for Apple-only; AsyncSequence and AsyncStream work everywhere Swift does (Linux, server, etc.)
  • Some subset of clients of automerge-swift will be using structured concurrency, and this allows them to skip a step bridging these reactive frameworks.

How?

  • All the existing ObservableObject conformance could instead be built on top of AsyncStream-based as the foundation to have a single source of truth for reactive signals coming from the document.
  • The Combine hooks + conformance remain as "opt-in as long as the target platform supports it" on top of an always-supported AsyncStream foundation.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions