Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Sync Laravel Package

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.

View on GitHub
Deep Wiki
Context7
v2.3.0

What's Changed

  • Fixed posix semaphore blocking thread when there is no space left on device by @azjezz in https://github.com/amphp/sync/pull/29
  • Added a buffer size parameter to createChannelPair() to specify a number of items which may be buffered in memory before back pressure is applied.

New Contributors

Full Changelog: https://github.com/amphp/sync/compare/v2.2.0...v2.3.0

v2.2.0
v2.1.0

What's Changed

New Contributors

Full Changelog: https://github.com/amphp/sync/compare/v2.0.0...v2.1.0

v2.0.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.

Changes from 1.x

  • ConcurrentIterator functions have been removed are now available as methods on Pipeline in amphp/pipeline
  • FileMutex has been removed, as a better implementation ships as part of amphp/file
  • Removed ThreadedMutex and ThreadedSemaphore
  • Removed Lock::getId()
  • Barrier::await supports cancellation now
  • synchronized accepts any Semaphore now instead of a Mutex only
  • Added Channel from amphp/parallel, which allows two way communicate between execution contexts, such as two coroutines or two processes. Channel has been modified to extend Closable
  • Also added Parcel from amphp/parallel, which allows sharing a value across execution contexts with mutually-exclusive access to modifying that value using Parcel::synchronized().
  • Added createChannelPair() function which returns a pair of connected Channel objects.
  • Added RateLimitingSemaphore which releases locks after a given time elapses.
  • Added StaticKeySemaphore, analogous to StaticKeyMutex

Changes from 2.0.0 Beta 6

  • Added RateLimitingSemaphore which releases locks after a given time elapses.
  • Added StaticKeySemaphore, analogous to StaticKeyMutex
v2.0.0-beta.6
  • Add compatibility with Revolt v1.x
v2.0.0-beta.5
  • Fixed return type of createChannelPair() to use the interface
  • Fixed close of channels returned from createChannelPair()
  • Release locks synchronously instead of asynchronously on explicit release() calls
v2.0.0-beta.4
  • PHP 8.1 now required.
  • Channel now extends Amp\Closable, which adds an onClose() method to attach a closure that is invoked when the channel closes.
v2.0.0-beta.3

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().
v2.0.0-beta.2
v2.0.0-beta.1

Note: This is a pre-release, there might be breaking changes in the final stable version.

  • Major release avoiding promises in favor of fibers supported by Revolt
  • ConcurrentIterator functions have been removed and will be available as operators in amphp/pipeline
  • FileMutex has been removed, as a better implementation ships as part of amphp/file
  • Removed ThreadedMutex and ThreadedSemaphore
  • Removed Lock::getId()
  • Barrier::await supports cancellation now
  • synchronized accepts any Semaphore now instead of a Mutex only
v1.4.2

What's Changed

  • Fixed PosixSemaphore deletion on PHP 8.

Full Changelog: https://github.com/amphp/sync/compare/v1.4.1...v1.4.2

v1.4.1

What's Changed

New Contributors

Full Changelog: https://github.com/amphp/sync/compare/v1.4.0...v1.4.1

v1.4.0
  • Added Amp\Sync\Barrier
  • Added Amp\Sync\ConcurrentIterator\transform()
  • Added Amp\Sync\ConcurrentIterator\map()
  • Added Amp\Sync\ConcurrentIterator\filter()
  • Added Amp\Sync\ConcurrentIterator\each()
v1.3.0
  • Added KeyedSemaphore
  • Added LocalKeyedSemaphore
  • Added PrefixedKeyedSemaphore
  • Mutex extends Semaphore now as a Mutex is a special form of Semaphore with exactly one lock
v1.2.0
  • Added LocalKeyedMutex
v1.1.0
  • Added KeyedMutex
  • Added PrefixedKeyedMutex
  • Added StaticKeyMutex
  • Deprecated ThreadedMutex because ext-pthreads development halted (see krakjoe/pthreads#929)
  • Deprecated ThreadedSemaphore because ext-pthreads development halted (see krakjoe/pthreads#929)
  • Raised requirement to PHP 7.1
v1.0.1

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…

v1.0.0

Initial release.

Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
davejamesmiller/laravel-breadcrumbs
artisanry/parsedown
christhompsontldr/phpsdk
enqueue/dsn
bunny/bunny
enqueue/test
enqueue/null
enqueue/amqp-tools
milesj/emojibase
bower-asset/punycode
bower-asset/inputmask
bower-asset/jquery
bower-asset/yii2-pjax
laravel/nova
spatie/laravel-mailcoach
spatie/laravel-superseeder
laravel/liferaft
nst/json-test-suite
danielmiessler/sec-lists
jackalope/jackalope-transport