LocalParcel
in package
implements
Parcel
uses
ForbidCloning, ForbidSerialization
FinalYes
Tags
Table of Contents
Interfaces
Properties
Methods
- __construct() : mixed
- __serialize() : never
- __unserialize() : never
- synchronized() : R
- Invokes a callback while maintaining a lock on the parcel. The current value of the parcel is provided as the first argument to the callback function. The return value of the callback is stored as the new value of the parcel.
- unwrap() : T
- __clone() : mixed
Properties
$mutex read-only
private
Mutex
$mutex
$value
private
mixed
$value
Methods
__construct()
public
__construct(Mutex $mutex, T $value) : mixed
Parameters
- $mutex : Mutex
- $value : T
__serialize()
public
final __serialize() : never
Return values
never__unserialize()
public
final __unserialize(array<string|int, mixed> $data) : never
Parameters
- $data : array<string|int, mixed>
Return values
neversynchronized()
Invokes a callback while maintaining a lock on the parcel. The current value of the parcel is provided as the first argument to the callback function. The return value of the callback is stored as the new value of the parcel.
public
synchronized(Closure $closure) : R
Parameters
- $closure : Closure
-
The closure to invoke when a lock is obtained on the parcel. The parcel value is given as the single argument to the closure. The return value is stored as the new parcel value.
Return values
R —The value of the parcel after the closure was invoked.
unwrap()
public
unwrap() : T
Return values
T —The value inside the parcel.
__clone()
protected
final __clone() : mixed