Channel

final case class Channel[-A](channel: Channel, convert: A => Any)

An immutable and type-safe representation of one or more netty channels. A represents the type of messages that can be written on the channel.

Companion:
object
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any

Value members

Concrete methods

def autoRead(flag: Boolean): UIO[Unit]

When set to true (default) it will automatically read messages from the channel. When set to false, the channel will not read messages until read is called.

When set to true (default) it will automatically read messages from the channel. When set to false, the channel will not read messages until read is called.

def awaitClose: UIO[Unit]

Provides a way to wait for the channel to be closed.

Provides a way to wait for the channel to be closed.

def close(await: Boolean): Task[Unit]

Closes the channel. Pass true to await to wait for the channel to be closed.

Closes the channel. Pass true to await to wait for the channel to be closed.

def contramap[A1](f: A1 => A): Channel[A1]

Creates a new channel that can write a different type of message by using a transformation function.

Creates a new channel that can write a different type of message by using a transformation function.

def flush: Task[Unit]

Flushes the pending write operations on the channel.

Flushes the pending write operations on the channel.

def id: String

Returns the globally unique identifier of this channel.

Returns the globally unique identifier of this channel.

Returns true if auto-read is set to true.

Returns true if auto-read is set to true.

def read: UIO[Unit]

Schedules a read operation on the channel. This is not necessary if auto-read is enabled.

Schedules a read operation on the channel. This is not necessary if auto-read is enabled.

def write(msg: A, await: Boolean): Task[Unit]

Schedules a write operation on the channel. The actual write only happens after calling flush. Pass true to await the completion of the write operation.

Schedules a write operation on the channel. The actual write only happens after calling flush. Pass true to await the completion of the write operation.

def writeAndFlush(msg: A, await: Boolean): Task[Unit]

Writes and flushes the message on the channel. Pass true to await the completion of the write operation.

Writes and flushes the message on the channel. Pass true to await the completion of the write operation.

Inherited methods

Inherited from:
Product