BaseProducer

public class BaseProducer<Update, Success> : Channel<Update, Success>, EventDestination

Mutable subclass of channel You can update and complete producer manually internal use only

  • amount of currently stored updates

    Declaration

    Swift

    override public var bufferSize: Int { get }
  • maximal amount of updates store

    Declaration

    Swift

    override public var maxBufferSize: Int { get }
  • completion of Producer. Returns nil if channel is not complete yet

    Declaration

    Swift

    override public var completion: Fallible<Success>? { get }
  • internal use only**

    Declaration

    Swift

    override public func makeHandler(
      executor: Executor,
      _ block: @escaping (_ event: ChannelEvent<Update, Success>, _ originalExecutor: Executor) -> Void
      ) -> AnyObject?
  • Sends specified Update to the Producer Value will not be sent for completed Producer

    Declaration

    Swift

    public func tryUpdate(
      _ update: Update,
      from originalExecutor: Executor?
      ) -> Bool

    Parameters

    update

    value to update with

    originalExecutor

    Executor you calling this method on. Specifying this argument will allow to perform syncronous executions on strictAsync: false Executors. Use default value or nil if you are not sure about an Executor you calling this method on.

  • Sends specified sequence of Update to the Producer Values will not be sent for completed Producer

    Declaration

    Swift

    public func update<S: Sequence>(
      _ updates: S,
      from originalExecutor: Executor? = nil
      ) where S.Iterator.Element == Update

    Parameters

    updates

    values to update with

    originalExecutor

    Executor you calling this method on. Specifying this argument will allow to perform syncronous executions on strictAsync: false Executors. Use default value or nil if you are not sure about an Executor you calling this method on.

  • Tries to complete the Producer

    Declaration

    Swift

    @discardableResult
    public func tryComplete(
      _ completion: Fallible<Success>,
      from originalExecutor: Executor? = nil
      ) -> Bool

    Parameters

    completion

    value to complete Producer with

    originalExecutor

    Executor you calling this method on. Specifying this argument will allow to perform syncronous executions on strictAsync: false Executors. Use default value or nil if you are not sure about an Executor you calling this method on.

    Return Value

    true if Producer was completed with this call, false if it was completed before

  • internal use only Inserts releasable to an internal release pool that will be drained on completion

    Declaration

    Swift

    override public func _asyncNinja_retainUntilFinalization(_ releasable: Releasable)
  • internal use only Inserts releasable to an internal release pool that will be drained on completion

    Declaration

    Swift

    override public func _asyncNinja_notifyFinalization(_ block: @escaping () -> Void)
  • Makes an iterator that allows synchronous iteration over update values of the channel

    Declaration

    Swift

    override public func makeIterator() -> Iterator