A set of linked lists of connections that can be reused.

Fields

mutex: std.Thread.Mutex = .{ },
used: Queue = .{ },

Open connections that are currently in use.

free: Queue = .{ },

Open connections that are not currently in use.

free_len: usize = 0,
free_size: usize = connection_pool_size,

Types

Functions

fn acquire(pool: *ConnectionPool, node: *Node) void

Acquires an existing connection from the connection pool. This function is threa…

Acquires an existing connection from the connection pool. This function is threadsafe.

fn acquireUnsafe(pool: *ConnectionPool, node: *Node) void

Acquires an existing connection from the connection pool. This function is not t…

Acquires an existing connection from the connection pool. This function is not threadsafe.

fn addUsed(pool: *ConnectionPool, node: *Node) void

Adds a newly created node to the pool of used connections. This function is thre…

Adds a newly created node to the pool of used connections. This function is threadsafe.

fn deinit(pool: *ConnectionPool, client: *Client) void

No documentation provided.

fn findConnection(pool: *ConnectionPool, criteria: Criteria) ?*Node

Finds and acquires a connection from the connection pool matching the criteria. …

Finds and acquires a connection from the connection pool matching the criteria. This function is threadsafe. If no connection is found, null is returned.

fn release(pool: *ConnectionPool, client: *Client, node: *Node) void

Tries to release a connection back to the connection pool. This function is thre…

Tries to release a connection back to the connection pool. This function is threadsafe. If the connection is marked as closing, it will be closed instead.

Values

Node
undefined