amphp/sync
Async synchronization primitives for Amp PHP: mutexes, semaphores, locks, and a synchronized helper. Coordinate concurrent fibers, ensure mutual exclusion, and cap parallel work (e.g., limit HTTP requests) with simple, safe abstractions.
createChannelPair() to specify a number of items which may be buffered in memory before back pressure is applied.Full Changelog: https://github.com/amphp/sync/compare/v2.2.0...v2.3.0
Full Changelog: https://github.com/amphp/sync/compare/v2.1.0...v2.2.0
synchronized() by @kelunik in https://github.com/amphp/sync/pull/26SharedMemoryParcelFull Changelog: https://github.com/amphp/sync/compare/v2.0.0...v2.1.0
Stable release compatible with AMPHP v3 and fibers! 🎉
As with other libraries compatible with AMPHP v3, most cases of parameters or returns of Promise<ResolutionType> have been replaced with ResolutionType.
ConcurrentIterator functions have been removed are now available as methods on Pipeline in amphp/pipelineFileMutex has been removed, as a better implementation ships as part of amphp/fileThreadedMutex and ThreadedSemaphoreLock::getId()Barrier::await supports cancellation nowsynchronized accepts any Semaphore now instead of a Mutex onlyChannel from amphp/parallel, which allows two way communicate between execution contexts, such as two coroutines or two processes. Channel has been modified to extend ClosableParcel from amphp/parallel, which allows sharing a value across execution contexts with mutually-exclusive access to modifying that value using Parcel::synchronized().createChannelPair() function which returns a pair of connected Channel objects.RateLimitingSemaphore which releases locks after a given time elapses.StaticKeySemaphore, analogous to StaticKeyMutexRateLimitingSemaphore which releases locks after a given time elapses.StaticKeySemaphore, analogous to StaticKeyMutexcreateChannelPair() to use the interfacecreateChannelPair()release() callsChannel now extends Amp\Closable, which adds an onClose() method to attach a closure that is invoked when the channel closes.This release moves Channel and Parcel interfaces from amphp/parallel to this library.
Channel allows two way communicate between execution contexts, such as two coroutines or two processes.Parcel allows sharing a value across execution contexts, with mutually-exclusive access to modifying that value using Parcel::synchronized().revolt/event-loop v0.2.x (https://github.com/amphp/sync/pull/20)Note: This is a pre-release, there might be breaking changes in the final stable version.
ConcurrentIterator functions have been removed and will be available as operators in amphp/pipelineFileMutex has been removed, as a better implementation ships as part of amphp/fileThreadedMutex and ThreadedSemaphoreLock::getId()Barrier::await supports cancellation nowsynchronized accepts any Semaphore now instead of a Mutex onlyPosixSemaphore deletion on PHP 8.Full Changelog: https://github.com/amphp/sync/compare/v1.4.1...v1.4.2
Full Changelog: https://github.com/amphp/sync/compare/v1.4.0...v1.4.1
Amp\Sync\BarrierAmp\Sync\ConcurrentIterator\transform()Amp\Sync\ConcurrentIterator\map()Amp\Sync\ConcurrentIterator\filter()Amp\Sync\ConcurrentIterator\each()KeyedSemaphoreLocalKeyedSemaphorePrefixedKeyedSemaphoreMutex extends Semaphore now as a Mutex is a special form of Semaphore with exactly one lockLocalKeyedMutexKeyedMutexPrefixedKeyedMutexStaticKeyMutexThreadedMutex because ext-pthreads development halted (see krakjoe/pthreads#929)ThreadedSemaphore because ext-pthreads development halted (see krakjoe/pthreads#929)Removed usage of anonymous class in ThreadedMutex and ThreadedSemaphore, instead both now use an internal pre-defined class. Anonymous classes cannot be transferred to a thread, so previously they could not actually be used in a thread as intended… oops…
Initial release.
How can I help you explore Laravel packages today?