pub trait ProxySession {
    fn protocol(&self) -> Protocol;
    fn ready(&mut self, session: Rc<RefCell<dyn ProxySession>>);
    fn process_events(&mut self, token: Token, events: Ready);
    fn close(&mut self);
    fn timeout(&mut self, t: Token);
    fn last_event(&self) -> Instant;
    fn print_state(&self);
    fn tokens(&self) -> Vec<Token> ;
    fn shutting_down(&mut self);
}
Expand description

trait that must be implemented by listeners and client sessions

Required Methods§

indicates the protocol associated with the session

this is used to distinguish sessions from listenrs, channels, metrics and timers

if a session received an event or can still execute, the event loop will call this method. Its result indicates if it can still execute, needs to connect to a backend server, close the session

if the event loop got an event for a token associated with the session, it will call this method on the session

closes a session

if a timeout associated with the session triggers, the event loop will call this method with the timeout’s token

last time the session got an event

displays the session’s internal state (for debugging purpose)

list the tokens associated with the session

tells the session to shut down if possible

if the session handles HTTP requests, it will not close until the response is completely sent back to the client

Implementors§