DataStreamPublisher
public struct DataStreamPublisher<Value> : Publisher where Value : Sendable
Undocumented
-
Declaration
Swift
public typealias Output = DataStreamRequest.Stream<Value, AFError>
-
Declaration
Swift
public typealias Failure = Never
-
Creates an instance which will serialize responses using the provided
DataStreamSerializer
.Declaration
Swift
public init<Serializer: DataStreamSerializer>(_ request: DataStreamRequest, queue: DispatchQueue, serializer: Serializer) where Value == Serializer.SerializedObject
Parameters
request
DataStreamRequest
for which to publish the response.queue
DispatchQueue
on which theStream<Value, AFError>
values will be published..main
by default.serializer
DataStreamSerializer
used to produce the publishedStream<Value, AFError>
values. -
Publishes only the
Result
of theDataStreamRequest.Stream
‘sEvent
s.Declaration
Swift
public func result() -> AnyPublisher<Result<Value, AFError>, Never>
Return Value
The
AnyPublisher
publishing theResult<Value, AFError>
value. -
Publishes the streamed values of the
DataStreamRequest.Stream
as a sequence ofValue
or fail with theAFError
instance.Declaration
Swift
public func value() -> AnyPublisher<Value, AFError>
Return Value
The
AnyPublisher<Value, AFError>
publishing the stream. -
Declaration
Swift
public func receive<S>(subscriber: S) where S : Subscriber, S : Sendable, S.Failure == Never, S.Input == DataStreamRequest.Stream<Value, AFError>