Set a partial function for the request processing handler for the connection.
Set a partial function for the request processing handler for the connection. Any request that
falls through the handler will be automatically converted into an error
response with a UnhandledRequestException
as the cause
Attach a handler for non-recoverable errors.
Attach a handler for non-recoverable errors. This includes uncaught exceptions, unhandled requests, request timeouts, and other server-level errors. In every case, this handler should not attempt to actually process the request, but instead simply return an appropriately formatted error response.
Set the handler for actor messages intended for this connection.
Set the handler for actor messages intended for this connection.
Provides a way to send this WorkerItem a message from an Actor by way of WorkerCommand.
Provides a way to send this WorkerItem a message from an Actor by way of WorkerCommand.Message.
The message that was sent
The sender who sent the message
Gets the sender of the current message being processed in the receive handler
Gets the sender of the current message being processed in the receive handler
When bound to a worker, this contains the [WorkerItemBinding]
When bound to a worker, this contains the [WorkerItemBinding]
This handler is called when a Worker new Connection is established.
This handler is called when a Worker new Connection is established. A Connection can be either an incoming (ie: something to connected to the server), or outgoing(ie: the server connected to a remote system).
Connection was closed on our end, either by a shutdown, or by normal means
Connection was closed on our end, either by a shutdown, or by normal means
why the connection was closed
Returns a read-only trait containing live information about the connection.
Returns a read-only trait containing live information about the connection.
Connection lost is caused by termination, closed, etc
Connection lost is caused by termination, closed, etc
why the connection was lost
Called from Worker when a connection has been terminated either by an error or by normal means.
Called from Worker when a connection has been terminated either by an error or by normal means.
why the connection was terminated
Terminate the connection, but allow any outstanding requests to complete (or timeout) before disconnecting
Terminate the connection, but allow any outstanding requests to complete (or timeout) before disconnecting
Called periodically on every attached connection handler, this can be used for checking if an ongoing operation has timed out.
Called periodically on every attached connection handler, this can be used for checking if an ongoing operation has timed out.
Be aware that this is totally independant of a connection's idle timeout, which is only based on the last time there was any I/O.
the frequency at which this method is called. Currently this is hardcoded to WorkerManager.IdleCheckFrequency
, but may become application dependent in the future.
Called when the item is bound to a worker.
Called when the item is bound to a worker.
Called when the item has been unbound from a worker
Called when the item has been unbound from a worker
Pauses writing of the next item in the queue.
Pauses writing of the next item in the queue. If there is currently a message in the process of writing, it will be unaffected. New messages can still be pushed to the queue as long as it is not full
Set a function for the request processing handler for the connection
Set a function for the request processing handler for the connection
Purge both pending and outgoing messages
Purge both pending and outgoing messages
Purge the outgoing message, if there is one
Purge the outgoing message, if there is one
If a message is currently being streamed, the stream will be terminated
Purge all pending messages
Purge all pending messages
If a message is currently being written, it is not affected
Push a message to be written
Push a message to be written
Pushing a message does not necessarily mean it will be written, but rather that the message is queued to be written. Messages can be queue regardless of the state of the underlying connection, even if the connection is never reconnected. It is up to the caller to determine whether a message should be pushed based on connection state.
the message to push
the timestamp of when the message was created, defaults to now if not specified
called either when writing has completed or failed
true if the message was successfully enqueued, false if the queue is full
This function is called to signal to the handler that it can resume writing data.
This function is called to signal to the handler that it can resume writing data. It is called as part of the WriteEndPoint event loop write cycle, where previously this handler attempted to write data, but the buffers were filled up. This is called once the buffers are empty again and able to receive data. This handler should be in a state where it is paused on writing data until this handler is invoked.
Handler which is called when data is received from a Connection.
Handler which is called when data is received from a Connection.
DataBuffer read from the underlying Connection.
Resumes writing of messages if currently paused, otherwise has no affect
Resumes writing of messages if currently paused, otherwise has no affect
The server is beginning to shutdown and is signaling to the connection that it should cleanup and terminate.
The server is beginning to shutdown and is signaling to the connection that it should cleanup and terminate. This gives the connection time to gracefully shutdown, however eventually the server will timeout and forcefully close the connection