ReferenceCounted

public final class ReferenceCounted<Upstream: Publisher, SubjectType: Subject>: Publisher
    where Upstream.Output == SubjectType.Output, Upstream.Failure == SubjectType.Failure

Automates the process of connecting to a multicast publisher. Connects when the first subscriber connects then cancels and discards when the subscriber count falls to zero.

  • Declaration

    Swift

    public typealias Output = Upstream.Output
  • Declaration

    Swift

    public typealias Failure = Upstream.Failure
  • Declaration

    Swift

    public func receive<S>(subscriber: S) where S : Subscriber, SubjectType.Failure == S.Failure, SubjectType.Output == S.Input