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. thesis/sync-once

ActiveLibrary

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

Thesis Sync Once

0.1.3(5mo ago)333.0k↓32.7%4MITPHPPHP ^8.3CI passing

Since May 7Pushed 5mo 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.1.x Synced 1mo ago

READMEChangelog (4)Dependencies (5)Versions (6)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

43

—

FairBetter than 91% of packages

Maintenance70

Regular maintenance activity

Popularity32

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity46

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 ~53 days

Total

5

Last Release

164d ago

### 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 (19 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

[vimeo/psalm

A static analysis tool for finding errors in PHP applications

5.8k77.5M6.7k](/packages/vimeo-psalm)[phpro/grumphp

A composer plugin that enables source code quality checks.

4.3k15.5M904](/packages/phpro-grumphp)[danog/madelineproto

Async PHP client API for the telegram MTProto protocol.

3.4k855.0k18](/packages/danog-madelineproto)[amphp/parallel

Parallel processing component for Amp.

85046.2M74](/packages/amphp-parallel)[amphp/byte-stream

A stream abstraction to make working with non-blocking I/O simple.

393116.2M104](/packages/amphp-byte-stream)[amphp/http-server

A non-blocking HTTP application server for PHP based on Amp.

1.3k4.5M81](/packages/amphp-http-server)

PHPackages © 2026

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