switon/sync

Channels, mutexes, and synchronization primitives for Switon Framework

Maintainers

Package info

github.com/switon-php/sync

Documentation

pkg:composer/switon/sync

Statistics

Installs: 41

Dependents: 3

Suggesters: 0

Stars: 0

Open Issues: 0

v1.0.0 2026-05-09 16:24 UTC

This package is auto-updated.

Last update: 2026-05-09 16:25:51 UTC


README

Channels, mutexes, and synchronization primitives for Switon Framework.

Installation

composer require switon/sync

Requirements: PHP 8.3+

Quick Start

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

License

MIT.