DataStreamPublisher

public struct DataStreamPublisher<Value> : Publisher

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 the Stream<Value, AFError> values will be published. .main by default.

    serializer

    DataStreamSerializer used to produce the published Stream<Value, AFError> values.

  • Publishes only the Result of the DataStreamRequest.Stream‘s Events.

    Declaration

    Swift

    public func result() -> AnyPublisher<Result<Value, AFError>, Never>

    Return Value

    The AnyPublisher publishing the Result<Value, AFError> value.

  • Publishes the streamed values of the DataStreamRequest.Stream as a sequence of Value or fail with the AFError 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.Failure == DataStreamPublisher<Value>.Failure, S.Input == DataStreamPublisher<Value>.Output