trait Channel[F[_], A, B] extends Pipe[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.
- Self Type
- Channel[F, A, B]
- Source
- Channel.scala
- See also
- Grouped
- Alphabetic
- By Inheritance
- Channel
- Function1
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Abstract Value Members
-
abstract
def
listen(maxQueued: Int): Stream[F, Notification[B]]
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 theSession
(although typically a dedicatedSession
will receive channel notifications so this won't be an issue).- maxQueued
the maximum number of notifications to hold in a queue before [semantically] blocking message exchange on the controlling
Session
.
- See also
-
abstract
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.
- See also
Concrete Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
andThen[A](g: (Stream[F, Unit]) ⇒ A): (Stream[F, A]) ⇒ A
- Definition Classes
- Function1
- Annotations
- @unspecialized()
-
def
apply(sa: Stream[F, A]): Stream[F, Unit]
This
Channel
acts as an fs2Pipe
.This
Channel
acts as an fs2Pipe
.- Definition Classes
- Channel → Function1
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
def
clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native()
-
def
compose[A](g: (A) ⇒ Stream[F, A]): (A) ⇒ Stream[F, Unit]
- Definition Classes
- Function1
- Annotations
- @unspecialized()
-
def
contramap[C](f: (C) ⇒ A): Channel[F, C, B]
Contramap messages from a new type
C
, yielding anChannel[D, C, B]
. -
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 typeD
, yielding aChannel[F, C, D]
. -
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] )
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
def
hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
def
map[D](f: (B) ⇒ D): Channel[F, A, D]
Map notifications to a new type
D
, yielding anChannel[D, A, D]
. -
def
mapK[G[_]](fk: ~>[F, G]): Channel[G, A, B]
Transform this
Channel
by a givenFunctionK
. -
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
def
toString(): String
- Definition Classes
- Function1 → AnyRef → Any
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native()