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.
Proposal: in addition to Combine, Document observation should have AsyncSequence + AsyncStream support.
Why?
AsyncSequenceandAsyncStreamwork everywhere Swift does (Linux, server, etc.)How?
ObservableObjectconformance could instead be built on top ofAsyncStream-based as the foundation to have a single source of truth for reactive signals coming from the document.Combinehooks + conformance remain as "opt-in as long as the target platform supports it" on top of an always-supportedAsyncStreamfoundation.