Channel

skunk.Channel
See theChannel companion object
trait Channel[F[_], A, B] extends (F, A) => Unit

A channel that can be used for inter-process communication, implemented in terms of LISTEN and NOTIFY. All instances start life as a Channel[F, String, Notification] but can be mapped out to different input and output types. See the linked documentation for more information on the transactional semantics of these operations.

Attributes

See also
Companion
object
Source
Channel.scala
Graph
Supertypes
trait Stream[F, A] => Stream[F, Unit]
class Object
trait Matchable
class Any
Self type
Channel[F, A, B]

Members list

Grouped members

Notifications

Construct a Stream that subscribes to notifications for this Channel, emits any notifications that arrive (this can happen at any time), then unsubscribes when the stream is terminated.

Construct a Stream that subscribes to notifications for this Channel, emits any notifications that arrive (this can happen at any time), then unsubscribes when the stream is terminated. Note that once such a stream is started it is important to consume all notifications as quickly as possible to avoid blocking message processing for other operations on the Session (although typically a dedicated Session will receive channel notifications so this won't be an issue).

Value parameters

maxQueued

the maximum number of notifications to hold in a queue before [semantically] blocking message exchange on the controlling Session.

Attributes

See also
Source
Channel.scala

Construct a Resource[F, Stream] that subscribes to notifications for this Channel that emits any notifications that arrive (this can happen at any time) once resource is acquired and unsubscribes when the resource is released.

Construct a Resource[F, Stream] that subscribes to notifications for this Channel that emits any notifications that arrive (this can happen at any time) once resource is acquired and unsubscribes when the resource is released. Note that once such a stream is started it is important to consume all notifications as quickly as possible to avoid blocking message processing for other operations on the Session (although typically a dedicated Session will receive channel notifications so this won't be an issue).

Value parameters

maxQueued

the maximum number of notifications to hold in a queue before [semantically] blocking message exchange on the controlling Session.

Attributes

See also
Source
Channel.scala
def notify(message: A): F[Unit]

Send a notification on the given channel.

Send a notification on the given channel. Note that if the session is in an active transaction the notification will only be sent if the transaction is committed. See the linked documentation for more information.

Attributes

See also
Source
Channel.scala

Transformations

def contramap[C](f: C => A): Channel[F, C, B]

Contramap messages from a new type C, yielding an Channel[D, C, B].

Contramap messages from a new type C, yielding an Channel[D, C, B].

Attributes

Source
Channel.scala
def dimap[C, D](f: C => A)(g: B => D): Channel[F, C, D]

Contramap inputs from a new type C and map outputs to a new type D, yielding a Channel[F, C, D].

Contramap inputs from a new type C and map outputs to a new type D, yielding a Channel[F, C, D].

Attributes

Source
Channel.scala
def map[D](f: B => D): Channel[F, A, D]

Map notifications to a new type D, yielding an Channel[D, A, D].

Map notifications to a new type D, yielding an Channel[D, A, D].

Attributes

Source
Channel.scala
def mapK[G[_]](fk: FunctionK[F, G])(implicit f: MonadCancel[F, _], g: MonadCancel[G, _]): Channel[G, A, B]

Transform this Channel by a given FunctionK.

Transform this Channel by a given FunctionK.

Attributes

Source
Channel.scala

Value members

Concrete methods

def apply(sa: Stream[F, A]): Stream[F, Unit]

This Channel acts as an fs2 Pipe.

This Channel acts as an fs2 Pipe.

Attributes

Source
Channel.scala

Inherited methods

def andThen[A](g: Stream[F, Unit] => A): T1 => A

Attributes

Inherited from:
Function1
def compose[A](g: A => Stream[F, A]): A => R

Attributes

Inherited from:
Function1
override def toString(): String

Returns a string representation of the object.

Returns a string representation of the object.

The default representation is platform dependent.

Attributes

Returns

a string representation of the object.

Definition Classes
Function1 -> Any
Inherited from:
Function1