TestChannel

zio.http.TestChannel
See theTestChannel companion object
case class TestChannel(in: Queue[WebSocketChannelEvent], out: Queue[WebSocketChannelEvent], promise: Promise[Nothing, Unit]) extends WebSocketChannel

Attributes

Companion
object
Source
TestChannel.scala
Graph
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all

Members list

Value members

Concrete methods

def awaitShutdown(implicit trace: Trace): UIO[Unit]

Await shutdown of the channel.

Await shutdown of the channel.

Attributes

Source
TestChannel.scala
def receive(implicit trace: Trace): Task[WebSocketChannelEvent]

Read a message from the channel, suspending until the next message is available.

Read a message from the channel, suspending until the next message is available.

Attributes

Source
TestChannel.scala
def receiveAll[Env, Err](f: WebSocketChannelEvent => ZIO[Env, Err, Any])(implicit trace: Trace): ZIO[Env, Err, Unit]

Reads all messages from the channel, handling them with the specified function.

Reads all messages from the channel, handling them with the specified function.

Attributes

Source
TestChannel.scala
def send(in: WebSocketChannelEvent)(implicit trace: Trace): Task[Unit]

Send a message to the channel.

Send a message to the channel.

Attributes

Source
TestChannel.scala
def sendAll(in: Iterable[WebSocketChannelEvent])(implicit trace: Trace): Task[Unit]

Send all messages to the channel.

Send all messages to the channel.

Attributes

Source
TestChannel.scala
def shutdown(implicit trace: Trace): UIO[Unit]

Shut down the channel.

Shut down the channel.

Attributes

Source
TestChannel.scala

Inherited methods

Constructs a new channel that automatically transforms messages sent to this channel using the specified function.

Constructs a new channel that automatically transforms messages sent to this channel using the specified function.

Attributes

Inherited from:
Channel
Source
Channel.scala
final def map[Out2](f: WebSocketChannelEvent => Out2)(implicit trace: Trace): Channel[WebSocketChannelEvent, Out2]

Constructs a new channel that automatically transforms messages received from this channel using the specified function.

Constructs a new channel that automatically transforms messages received from this channel using the specified function.

Attributes

Inherited from:
Channel
Source
Channel.scala

Attributes

Inherited from:
Product

Attributes

Inherited from:
Product