Documentation

LocalParcel
in package
implements Parcel uses ForbidCloning, ForbidSerialization

FinalYes
Tags
template
template-implements

Table of Contents

Interfaces

Parcel

Properties

$mutex  : Mutex
$value  : mixed

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

Methods

__construct()

public __construct(Mutex $mutex, T $value) : mixed
Parameters
$mutex : Mutex
$value : T

__unserialize()

public final __unserialize(array<string|int, mixed> $data) : never
Parameters
$data : array<string|int, mixed>
Return values
never

synchronized()

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.


        
On this page

Search results