Module hapi_rs::session

source ·
Expand description

Session is responsible for communicating with HAPI

The Engine promises to be thread-safe when accessing a single Session from multiple threads. hapi-rs relies on this promise and the Session struct holds only an Arc pointer to the session, and does not protect the session with Mutex, although there is a parking_lot::ReentrantMutex private member which is used internally in a few cases where API calls must be sequential.

When the last instance of the Session is about to get dropped, it’ll be cleaned up (if SessionOptions::cleanup was set) and automatically closed.

The Engine process (pipe or socket) can be auto-terminated as well if told so when starting the server: See start_engine_pipe_server and start_engine_socket_server

quick_session terminates the server by default. This is useful for quick one-off jobs.

Structs

Session represents a unique connection to the Engine instance and all API calls require a valid session. It implements Clone and is Send and Sync
Session options passed to session create functions like connect_to_pipe
A build for SessionOptions.

Enums

Traits

Functions

Connect to the engine process via a pipe file.
Connect to the engine process via a Unix socket
Create in-process session
A quick drop-in session, useful for on-off jobs It starts a single-threaded pipe server and initialize a session with default options
Spawn a new pipe Engine process and return its PID
Spawn a new socket Engine server and return its PID