Channels, mutexes, and synchronization primitives for Switon Framework.
composer require switon/syncRequirements: PHP 8.3+
use Switon\Sync\Channel;
use Switon\Sync\WaitGroup;
$channel = new Channel(10);
$channel->push('task-1');
$task = $channel->pop(); // 'task-1'
$wg = WaitGroup::of(2);
// task A
$wg->done();
// task B
$wg->done();
$wg->wait();Docs: https://docs.switon.dev/latest/sync
MIT.