Observe

final case class Observe[F[_], A, Msg](id: String, observable: F[(Either[Throwable, A] => Unit) => F[Option[F[Unit]]]], toMsg: A => Option[Msg]) extends Sub[F, Msg]

A subscription that forwards the notifications produced by the given observable

Type parameters:
A

type of notification values produced by the observable

F

type of the effect monad, must be a Cats Effect 3 Concurrent.

Msg

type of message produced by the subscription

Value parameters:
id

Globally unique identifier for this subscription

observable

Observable and cancellable/closable effect that produces notifications. Encoded as a callback with an effect describing how to optionally close the subscription.

toMsg

a function that turns every notification value into a possible message

Companion:
object
trait Serializable
trait Product
trait Equals
trait Sub[F, Msg]
class Object
trait Matchable
class Any

Value members

Concrete methods

def map[OtherMsg](f: Msg => OtherMsg): Sub[F, OtherMsg]

Transforms the type of messages produced by the subscription

Transforms the type of messages produced by the subscription

Inherited methods

def combine[F2[x], LubMsg >: Msg](other: Sub[F2, LubMsg]): Sub[F2, LubMsg]

Infix operation for combining two Subs into one.

Infix operation for combining two Subs into one.

Inherited from:
Sub
Inherited from:
Product
def |+|[F2[x], LubMsg >: Msg](other: Sub[F2, LubMsg]): Sub[F2, LubMsg]

Infix operator for combining two Subs into one.

Infix operator for combining two Subs into one.

Inherited from:
Sub