PHPackages                             thesis/sync-once - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. thesis/sync-once

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

thesis/sync-once
================

Thesis Sync Once

0.2.0(1mo ago)351.3k↓53.9%4MITPHPPHP ^8.4CI passing

Since May 7Pushed 1mo ago2 watchersCompare

[ Source](https://github.com/thesis-php/sync-once)[ Packagist](https://packagist.org/packages/thesis/sync-once)[ Fund](https://www.tinkoff.ru/cf/5MqZQas2dk7)[ RSS](/packages/thesis-sync-once/feed)WikiDiscussions 0.2.x Synced 2w ago

READMEChangelog (5)Dependencies (11)Versions (8)Used By (4)

Thesis Sync Once
================

[](#thesis-sync-once)

[![PHP Version Requirement](https://camo.githubusercontent.com/71d545bbfcd998e991568ba63f7d258861e3ae8873821328c6b932713338ae3a/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f646570656e64656e63792d762f7468657369732f73796e632f706870)](https://packagist.org/packages/thesis/sync)[![GitHub Release](https://camo.githubusercontent.com/879723185db8b81e60b2f610c8984333fe95e3597b2facba55f7c92e69b4731e/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f762f72656c656173652f7468657369732d7068702f73796e63)](https://github.com/thesis-php/sync/releases)[![Code Coverage](https://camo.githubusercontent.com/69a49bd730aaba1b257cae38cb86fad0f8d867083c7fa73b2ea8ff4051c6535a/68747470733a2f2f636f6465636f762e696f2f67682f7468657369732d7068702f73796e632f6272616e63682f302e312e782f67726170682f62616467652e737667)](https://codecov.io/gh/thesis-php/sync/tree/0.1.x)[![Mutation testing badge](https://camo.githubusercontent.com/d675fb70302dba4d82cb5b55fb3484730c63e4ae68a88b612934175a7a8a7610/68747470733a2f2f696d672e736869656c64732e696f2f656e64706f696e743f7374796c653d666c61742675726c3d687474707325334125324625324662616467652d6170692e737472796b65722d6d757461746f722e696f2532466769746875622e636f6d2532467468657369732d70687025324673796e63253246302e312e78)](https://dashboard.stryker-mutator.io/reports/github.com/thesis-php/sync/0.1.x)

Installation
------------

[](#installation)

```
composer require thesis/sync-once
```

Usage
-----

[](#usage)

```
use Amp\TimeoutCancellation;
use Thesis\Amqp\Channel;
use Thesis\Amqp\Client;
use Thesis\Amqp\Message;
use Thesis\Sync\Once;

final readonly class AmqpTransport
{
    /**
     * @var Once
     */
    private Once $publishChannel;

    public function __construct(
        private Client $client,
    ) {
        $this->publishChannel = new Once(
            // make sure to use static closures to avoid circular references
            function: static fn (): Channel => $client->channel(),
            isAlive: static fn (Channel $channel): bool => !$channel->isClosed(),
        );
    }

    public function publish(Message $message): void
    {
        $this
            ->publishChannel
            ->await(new TimeoutCancellation(10))
            ->publish($message);
    }
}
```

###  Health Score

50

—

FairBetter than 95% of packages

Maintenance92

Actively maintained with recent releases

Popularity33

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity50

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~71 days

Recently: every ~57 days

Total

7

Last Release

40d ago

PHP version history (2 changes)0.1.0PHP ^8.3

0.2.0PHP ^8.4

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/2552865?v=4)[Valentin Udaltsov](/maintainers/vudaltsov)[@vudaltsov](https://github.com/vudaltsov)

---

Top Contributors

[![vudaltsov](https://avatars.githubusercontent.com/u/2552865?v=4)](https://github.com/vudaltsov "vudaltsov (29 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/thesis-sync-once/health.svg)

```
[![Health](https://phpackages.com/badges/thesis-sync-once/health.svg)](https://phpackages.com/packages/thesis-sync-once)
```

###  Alternatives

[phpro/grumphp

A composer plugin that enables source code quality checks.

4.3k17.0M1.1k](/packages/phpro-grumphp)[amphp/process

A fiber-aware process manager based on Amp and Revolt.

25763.8M74](/packages/amphp-process)[phel-lang/phel-lang

Phel is a functional programming language that compiles to PHP

5196.5k22](/packages/phel-lang-phel-lang)[amphp/parallel-functions

Parallel processing made simple.

27810.7M27](/packages/amphp-parallel-functions)[amphp/pipeline

Asynchronous iterators and operators.

8042.8M56](/packages/amphp-pipeline)[chevere/workflow

Declarative workflow engine for PHP with automatic dependency resolution, sync/async job execution, and type-safe response chaining.

1722.2k2](/packages/chevere-workflow)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
