FiberLocal
in package
FinalYes
Fiber local storage.
Each instance stores data separately for each fiber. Usage examples include contextual logging data.
Tags
Table of Contents
Properties
- $initializer : Closure
- $localStorage : WeakMap|null
- $mainFiber : Fiber|null
Methods
- __construct() : mixed
- clear() : void
- get() : T
- set() : void
- unset() : void
- getFiberStorage() : WeakMap
Properties
$initializer read-only
private
Closure
$initializer
$localStorage
private
static WeakMap|null
$localStorage
= null
$mainFiber
private
static Fiber|null
$mainFiber
= null
Dummy fiber for {main}
Methods
__construct()
public
__construct(callable(): T $initializer) : mixed
Parameters
- $initializer : callable(): T
clear()
public
static clear() : void
get()
public
get() : T
Return values
Tset()
public
set(T $value) : void
Parameters
- $value : T
unset()
public
unset() : void
getFiberStorage()
private
static getFiberStorage() : WeakMap