API Reference — Pool — get
New to the concept? See Building Blocks — Pool first.
get
- Non-blocking acquisition.
- Calls
on_gethook. - Moves the handle —
slot.*set to non-null on success. - Assert:
pool.is_it_you(ph.*.tag)slot.* == null- Pool initialized.
- Tag registered.
get_wait
pub fn get_wait(ph: PoolHandle, tag: *const anyopaque, slot: *Slot, timeout_ns: ?u64) (GetError || Cancelable || error{Timeout})!void
- Blocking acquisition.
nulltimeout = wait forever.timeout_ns = 0returnserror.Timeoutimmediately.- Logically equivalent to
get(.available_only), but a different error (error.Timeoutvserror.NotAvailable). - Intentional:
get_waitalways uses the timeout error set, regardless of the timeout value. - Calls
on_gethook. - Assert:
pool.is_it_you(ph.*.tag)slot.* == null- Pool initialized.
- Tag registered.
Next: put / put_all.