Amp\Parallel\Sync\Parcel interface Parcel

A parcel object for sharing data across execution contexts.

A parcel is an object that stores a value in a safe way that can be shared between different threads or processes. Different handles to the same parcel will access the same data, and a parcel handle itself is serializable and can be transported to other execution contexts.

Wrapping and unwrapping values in the parcel are not atomic. To prevent race conditions and guarantee safety, you should use the provided synchronization methods to acquire a lock for exclusive access to the parcel first before accessing the contained value.

Summary

Properties

Methods

Methods

synchronized — public function synchronized(callable $callback): Amp\Promise
No documentation.
Type Parameter Description Default Value
callable $callback No documentation. none
unwrap — public function unwrap(): Amp\Promise
No documentation.