Parcel
in
Tags
Table of Contents
Methods
- 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
Methods
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(callable(T): R $closure) : R
Parameters
- $closure : callable(T): R
-
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.
Tags
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.