The following methods are provided by this mixin.
tangence_closed
$stream->tangence_closed;
Informs the object that the underlying connection has now been closed, and any attachments to
"Tangence::Object" or "Tangence::ObjectProxy" instances should now be dropped.
tangence_readfrom
$stream->tangence_readfrom( $buffer );
Informs the object that more data has been read from the underlying connection stream. Whole messages
will be removed from the beginning of the $buffer, which should be passed as a direct scalar (because it
will be modified). This method will invoke the required "handle_request_*" methods. Any bytes remaining
that form the start of a partial message will be left in the buffer.
request
$stream->request( %args );
Serialises a message object to pass to the "tangence_write" method, then enqueues a response handler to
be invoked when a reply arrives. Takes the following named arguments:
request => Tangence::Message
The message body
on_response => CODE
CODE reference to the callback to be invoked when a response to the message is received. It will
be passed the response message:
$on_response->( $message );
request(non-void)
$response = await $stream->request( request => $request );
When called in non-void context, this method returns a Future that will yield the response instead. In
this case it should not be given an "on_response" callback.
In this form, a "MSG_ERROR" response will automatically turn into a failed Future; the subsequent "then"
or "on_done" code will not have to handle this case.
respond
$stream->respond( $token, $message );
Serialises a message object to be sent to the "tangence_write" method. The $token value that was passed
to the "handle_request_" method ensures that it is sent at the correct position in the stream, to allow
the peer to pair it with the corresponding request.
minor_version
$ver = $stream->minor_version;
Returns the minor version negotiated by the "MSG_INIT" / "MSG_INITED" initial message handshake.