GitXplorerGitXplorer
g

TFFPublishers

public
0 stars
0 forks
0 issues

Commits

List of commits on branch main.
Unverified
1810f47e3a1eae84bf997c0e028cf45de678fbc0

adjusting after checking that the bug has been fixed

gglessard committed 4 years ago
Unverified
7189fc9d60f400bea59d7c12220b0afc83db841f

No need for a Double.

gglessard committed 4 years ago
Unverified
07fb3de90e6dbc9aae71d268a5428fd40884395f

adjusted after checking with reality

gglessard committed 4 years ago
Verified
e4f23912327aa957354cc0fc1bba509fcaceebb9

Update README.md

gglessard committed 4 years ago
Unverified
3b34ff575cbd0eee4b0a05e0df04b5ee5861d8a7

rename type parameters of `ConcatenateMany` and `Repeat`

gglessard committed 4 years ago
Unverified
635d454498af40bd50ff459272629fe3b18715f0

rename type parameters of `IntervalPublisher`

gglessard committed 4 years ago

README

The README file for this repository.

TFFPublishers Build Status

Some Publishers for use with Combine

ConcatenateMany:

Concatenate the outputs of a Stream of Publishers.

public struct ConcatenateMany<Publishers: Sequence>: Publisher
  where S.Element: Publisher
{
  public typealias Output =  Publishers.Element.Output
  public typealias Failure = Publishers.Element.Failure

  public init(publishers: Publishers)
}

ConcatenateMany terminates normally (with Completion.finished) only after all its inputs have terminated. The inputs proceed in order, with no interleaving. ConcatenateMany terminates with error on the first error encountered.

Repeat:

Re-subscribes to a Publisher whenever it ends normally (with Completion.finished)

public struct Repeat<Upstream: Publisher>: Publisher
{
  public typealias Output =  Upstream.Output
  public typealias Failure = Upstream.Failure

  public init(publisher: Upstream)
}

Repeat only terminates with an error or after its Subscriber cancels.

IntervalPublisher:

Waits for a time interval before requesting the next element from its upstream Publisher

public struct IntervalPublisher<Upstream: Publisher, Context: Scheduler>: Publisher
{
  public typealias Output =  Upstream.Output
  public typealias Failure = Upstream.Failure
  public typealias Interval = Context.SchedulerTimeType.Stride

  public init(publisher: Upstream, scheduler: Context, initialValue: Output? = nil,
              interval: @escaping (_ previous: Output?, _ current: Output) -> Interval,
              initialInterval: @escaping(_ initialValue: Output?) -> Interval = { _ in .seconds(0) })
              
  public init(publisher: Upstream, scheduler: Context, initialValue: Output? = nil, interval: Interval)
}

extension IntervalPublisher where Context == DispatchQueue
{
  public init(publisher: Upstream, qos: DispatchQoS = default, initialValue: Output? = nil,
              interval: @escaping (_ previous: Output?, _ current: Output) -> Interval,
              initialInterval: @escaping(_ initialValue: Output?) -> Interval = { _ in .seconds(0) })

  public init(publisher: Pustream, qos: DispatchQoS = default, initialValue: Output? = nil, interval: Interval)              
}

All requests to the upstream Subscription and deliveries to the downstream Subscriber occur on the same Scheduler.