PHPackages                             kim1ne/loop-server - 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. kim1ne/loop-server

ActiveLibrary

kim1ne/loop-server
==================

1.1.1(1y ago)17MITPHPPHP &gt;=8.1

Since Jan 12Pushed 1y ago1 watchersCompare

[ Source](https://github.com/kim1ne/loop-server)[ Packagist](https://packagist.org/packages/kim1ne/loop-server)[ RSS](/packages/kim1ne-loop-server/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (1)Versions (4)Used By (0)

Installation
============

[](#installation)

This package can be installed as a [Composer](https://getcomposer.org/) dependency.

```
composer require kim1ne/loop-server
```

This component unites all libraries, where needs start an infinite process. Example:

---

Producers publishing messages to the kafka. Workers expect messages from the kafka and when got messages, sending to the socket server. The socket-server sending messages to all connected clients [![image](https://private-user-images.githubusercontent.com/111231185/404436314-5657a5c2-7583-492c-ad05-bf16f2aeac2a.png?jwt=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3NzUxNjgwOTgsIm5iZiI6MTc3NTE2Nzc5OCwicGF0aCI6Ii8xMTEyMzExODUvNDA0NDM2MzE0LTU2NTdhNWMyLTc1ODMtNDkyYy1hZDA1LWJmMTZmMmFlYWMyYS5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjYwNDAyJTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI2MDQwMlQyMjA5NThaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT1mNmU4YmE0MGZmYjFjMDAwMzM4OTI5YWJhMmIwNmNmYjUyMmQ5ODIzMjg5YzFkZjY3MzQ2Yzk4OWZkMjUyNGE2JlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCJ9.pdxjBkceaOX23fXCEU2rKvyNjCD5Uvz9TFufQV17y4o)](https://private-user-images.githubusercontent.com/111231185/404436314-5657a5c2-7583-492c-ad05-bf16f2aeac2a.png?jwt=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3NzUxNjgwOTgsIm5iZiI6MTc3NTE2Nzc5OCwicGF0aCI6Ii8xMTEyMzExODUvNDA0NDM2MzE0LTU2NTdhNWMyLTc1ODMtNDkyYy1hZDA1LWJmMTZmMmFlYWMyYS5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjYwNDAyJTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI2MDQwMlQyMjA5NThaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT1mNmU4YmE0MGZmYjFjMDAwMzM4OTI5YWJhMmIwNmNmYjUyMmQ5ODIzMjg5YzFkZjY3MzQ2Yzk4OWZkMjUyNGE2JlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCJ9.pdxjBkceaOX23fXCEU2rKvyNjCD5Uvz9TFufQV17y4o)

```
use RdKafka\Conf;
use Kim1ne\Socket\Server\Server;
use Kim1ne\Socket\Server\Connection;
use Kim1ne\Socket\Server\Message;
use Kim1ne\Socket\Server\Transport;
use Kim1ne\Kafka\KafkaWorker;
use Kim1ne\Kafka\KafkaConsumer;
use Kim1ne\Kafka\Message as KafkaMessage;

$server = $server = new Server(transport: Transport::WS);

$server->on('message', function (Message $message, Connection $connection, Server $server) {
    InputMessage::green("I've got the message!");
});

$conf = new Conf(...);

$worker = new KafkaWorker($conf);
$worker->subscribe(['my-topic'])

$worker->on(function (KafkaMessage $message, KafkaConsumer $consumer) use ($server) {
    $consumer->commitAsync($message);
    $server->sendAll($message->payload);
});

\Kim1ne\Loop\Server::run($server, $worker);
```

 Version 1.1.0- All components have been updated 1.1.0
- A component has a scope-name. It has the method - getScopeName() - returns the scope-name. All events, which sends a component will merge with the scope-name.
- All components are isolated from each other. A component can sends an event, and another component will waiting for the event

---

Example: the object [KafkaWorker](https://github.com/kim1ne/kim1ne-kafka/blob/main/src/Kafka/KafkaWorker.php) has scope-name - `kafka:worker`, and sends an event `message`, the event will called `kafka:worker:message`

```
use Kim1ne\Socket\Server\Server;
use Kim1ne\Kafka\KafkaWorker;
use Kim1ne\Kafka\Message;
use Kim1ne\Kafka\KafkaConsumer;
use Kim1ne\Core\Event;

/**
 * @var Server $server
 */
$server->on('kafka:worker:message', function (Event $event) use ($server) {
    $message = $event->get('message');
    $server->sendAll($message);
});

/**
 * @var KafkaWorker $worker
 */
$worker->on('message', function (Message $message, KafkaConsumer $consumer) use ($worker) {
    $worker->dispatchEvent('message', new Event([
        'message' => $message->payload
    ]));
});
```

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance43

Moderate activity, may be stable

Popularity6

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity49

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

Total

3

Last Release

459d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/5994f47078df908351e43136f67ea6a8369eeca0945a8d8d500863a36c26b65b?d=identicon)[kim1ne](/maintainers/kim1ne)

---

Top Contributors

[![kim1ne](https://avatars.githubusercontent.com/u/111231185?v=4)](https://github.com/kim1ne "kim1ne (1 commits)")

### Embed Badge

![Health badge](/badges/kim1ne-loop-server/health.svg)

```
[![Health](https://phpackages.com/badges/kim1ne-loop-server/health.svg)](https://phpackages.com/packages/kim1ne-loop-server)
```

PHPackages © 2026

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