IoHandler

cc.otavia.core.reactor.IoHandler
abstract class IoHandler(val system: ActorSystem)

Handles IO dispatching for an cc.otavia.core.actor.AbstractChannelsActor All operations except wakeup and isCompatible MUST be executed on the cc.otavia.core.reactor.Reactor and should never be called from the user-directly.

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Known subtypes
class NioHandler

Members list

Value members

Abstract methods

def bind(channel: AbstractChannel, local: SocketAddress): Unit
def close(channel: AbstractChannel): Unit
def connect(channel: AbstractChannel, remote: SocketAddress, local: Option[SocketAddress], fastOpen: Boolean): Unit
def deregister(channel: AbstractChannel): Unit

Deregister a AbstractChannel for IO.

Deregister a AbstractChannel for IO.

Value parameters

channel

the AbstractChannel to deregister..

Attributes

Throws
Exception

thrown if an error happens during deregistration.

def destroy(): Unit

Destroy the IoHandler and free all its resources.

Destroy the IoHandler and free all its resources.

Attributes

def disconnect(channel: AbstractChannel): Unit
def flush(channel: AbstractChannel, payload: FileRegion | RecyclablePageBuffer): Unit
def isCompatible(handleType: Class[_ <: AbstractChannel]): Boolean

Returns true if the given type is compatible with this IoHandler and so can be registered, false otherwise.

Returns true if the given type is compatible with this IoHandler and so can be registered, false otherwise.

Value parameters

handleType

the type of the AbstractChannel.

Attributes

Returns

if compatible of not.

def open(channel: AbstractChannel, path: Path, options: Seq[OpenOption], attrs: Seq[FileAttribute[_]]): Unit
def prepareToDestroy(): Unit

Prepare to destroy this IoHandler. This method will be called before destroy and may be called multiple times.

Prepare to destroy this IoHandler. This method will be called before destroy and may be called multiple times.

Attributes

def read(channel: AbstractChannel, plan: ReadPlan): Unit
def register(channel: AbstractChannel): Unit

Register a AbstractChannel for IO.

Register a AbstractChannel for IO.

Value parameters

channel

the AbstractChannel to register.

Attributes

def run(context: IoExecutionContext): Int

Run the IO handled by this IoHandler. The IoExecutionContext should be used to ensure we not execute too long and so block the processing of other task that are scheduled on the cc.otavia.core.actor.ChannelsActor . This is done by taking IoExecutionContext.delayNanos or IoExecutionContext.deadlineNanos into account.

Run the IO handled by this IoHandler. The IoExecutionContext should be used to ensure we not execute too long and so block the processing of other task that are scheduled on the cc.otavia.core.actor.ChannelsActor . This is done by taking IoExecutionContext.delayNanos or IoExecutionContext.deadlineNanos into account.

Attributes

Returns

the number of IoHandle for which I/O was handled.

def shutdown(channel: AbstractChannel, direction: ChannelShutdownDirection): Unit
def wakeup(): Unit

Wakeup the IoHandler, which means if any operation blocks it should be unblocked and return as soon as possible.

Wakeup the IoHandler, which means if any operation blocks it should be unblocked and return as soon as possible.

Attributes

Concrete fields