Std.Db.pool
1 declaration
fn
pool: &Std.Db.Session.Config -> Int -> Result[Std.Db.Pool, Std.Db.Session.DbError]This is a callable function.
What it does
A pool of open connections, shared between threads.
The connections are held in a channel, which is what makes taking one wait
rather than fail when they are all in use: a channel's receive already
blocks until something is there, so the pool needs no waiting of its own.
It also means a pool cannot hand out more connections than it opened, which
is the whole reason a database wants one.
Read the signature
- The text after the name is the type checked by Pudu.
- Read arrows from left to right: inputs come first, and the final type is returned.
- & borrows a value for this call instead of moving or copying it.
- Names inside [ ] are type arguments, such as the item type held by a collection.
- Result makes success and recoverable failure part of the function's type.
