AsyncValueObservation
@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
public struct AsyncValueObservation<Element> : AsyncSequence
An asynchronous sequence of database changes.
Usage:
let observation = ValueObservation.tracking(Player.fetchAll)
let dbQueue: DatabaseQueue: ...
// Each database change in the player prints "Fresh players: ..."
for try await players in observation.values(in: dbQueue) {
print("Fresh players: \(players)")
}
See ValueObservation
for more information.
Note
This async sequence never ends.-
Undocumented
Declaration
Swift
public typealias BufferingPolicy = AsyncThrowingStream<Element, Error>.Continuation.BufferingPolicy
-
Declaration
Swift
public typealias AsyncIterator = Iterator
-
Declaration
Swift
public func makeAsyncIterator() -> Iterator
-
Declaration
Swift
public struct Iterator : AsyncIteratorProtocol