Trait tarantool::net_box::ConnTriggers
source · [−]pub trait ConnTriggers {
fn on_connect(&self, conn: &Conn) -> Result<(), Error>;
fn on_disconnect(&self);
fn on_schema_reload(&self, conn: &Conn);
}
Expand description
Provides triggers for connect, disconnect and schema reload events.
Required Methods
Defines a trigger for execution when a new connection is established, and authentication and schema fetch are
completed due to an event such as connect
.
If the trigger execution fails and an exception happens, the connection’s state changes to error
. In this
case, the connection is terminated.
fn on_disconnect(&self)
fn on_disconnect(&self)
Define a trigger for execution after a connection is closed.
fn on_schema_reload(&self, conn: &Conn)
fn on_schema_reload(&self, conn: &Conn)
Define a trigger executed when some operation has been performed on the remote server after schema has been updated. So, if a server request fails due to a schema version mismatch error, schema reload is triggered.