Topic

abstract class Topic[F <: ([_$1] =>> Any), A]
Topic allows you to distribute As published by an arbitrary
number of publishers to an arbitrary number of subscribers.
Topic has built-in back-pressure support implemented as the maximum
number of elements (maxQueued) that a subscriber is allowed to enqueue.
Once that bound is hit, any publishing action will semantically
block until the lagging subscriber consumes some of its queued
elements.
Companion
object
class Object
trait Matchable
class Any

Value members

Methods

def publish: (F, A) => Nothing
Publishes elements from source of A to this topic.
Pipe equivalent of publish1.
def publish1(a: A): F[Unit]
Publishes one A to topic.
This operation does not complete until after the given element
has been enqued on all subscribers, which means that if any
subscriber is at its maxQueued limit, publish1 will
semantically block until that subscriber consumes an element.
A semantically blocked publication can be interrupted, but there is
no guarantee of atomicity, and it could result in the A being
received by some subscribers only.
Note: if publish1 is called concurrently by multiple producers,
different subscribers may receive messages from different producers
in a different order.
def subscribe(maxQueued: Int): Stream[F, A]
Subscribes for A values that are published to this topic.
Pulling on the returned stream opens a "subscription", which allows up to
maxQueued elements to be enqueued as a result of publication.
If at any point, the queue backing the subscription has maxQueued elements in it,
any further publications semantically block until elements are dequeued from the
subscription queue.
Value Params
maxQueued
maximum number of elements to enqueue to the subscription
queue before blocking publishers
def subscribeAwait(maxQueued: Int): Resource[F, Stream[F, A]]
Like subscribe, but represents the subscription explicitly as
a Resource which returns after the subscriber is subscribed,
but before it has started pulling elements.
def subscribers: Stream[F, Int]
Signal of current active subscribers.
def imap[B](f: A => B)(g: B => A): Topic[F, B]
Returns an alternate view of this Topic where its elements are of type B,
given two functions, A => B and B => A.