PHPackages                             andersundsehr/server-send-events - 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. andersundsehr/server-send-events

ActiveLibrary

andersundsehr/server-send-events
================================

Utility Package to help with the creation of text/event-stream

1.0.4(11mo ago)01.4k↓100%GPL-2.0-or-laterPHPPHP ~8.2.0 || ~8.3.0 || ~8.4.0CI passing

Since Jun 29Pushed 11mo ago1 watchersCompare

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

READMEChangelog (5)Dependencies (2)Versions (6)Used By (0)

erver-send-events package
=========================

[](#erver-send-events-package)

install
-------

[](#install)

```
composer req andersundsehr/server-send-events
```

what does it do
---------------

[](#what-does-it-do)

it makes it easy to use the `text/event-stream` (Server Send Events).

inside your Controller:

```
if (ServerSendEventStream::isEventStream($this->request)) {
    $stream = new ServerSendEventStream();
    $trigger = new FileEventTrigger($stream);

    $stopTime = time() + (5 * 60);
    do {
        $stream->sendMessage($this->getInfo()); // is send to the JS long running script

        $trigger->sleepUntilTrigger('changed-' . $currentUser->getUid(), $stopTime);
    } while (time() < $stopTime);
    die();
}
```

somewhere else in the code:

```
(new FileEventTrigger())->trigger('changed-' . $currentUser->getUid());
```

in your JS

```
//EventSource as an auto restart :)
const evtSource = new EventSource(url, {
  withCredentials: true,
});
evtSource.addEventListener("message", (e) => {
  const data = JSON.parse(e.data);
  // do stuff with the data
  // data comes from $stream->sendMessage()
});
```

with ♥️ from anders und sehr GmbH
=================================

[](#with-️-from-anders-und-sehr-gmbh)

> If something did not work 😮
> or you appreciate this Extension 🥰 let us know.

> We are hiring

###  Health Score

40

—

FairBetter than 87% of packages

Maintenance54

Moderate activity, may be stable

Popularity19

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity65

Established project with proven stability

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

Total

5

Last Release

352d ago

PHP version history (2 changes)1.0.0PHP ~8.2.0

1.0.4PHP ~8.2.0 || ~8.3.0 || ~8.4.0

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/471387?v=4)[Matthias Vogel](/maintainers/Kanti)[@Kanti](https://github.com/Kanti)

![](https://www.gravatar.com/avatar/ce27306c234536251754f00414959671d4a775e9cf57cce2f5ea1dca158183d6?d=identicon)[andersundsehr](/maintainers/andersundsehr)

---

Top Contributors

[![Kanti](https://avatars.githubusercontent.com/u/471387?v=4)](https://github.com/Kanti "Kanti (7 commits)")

### Embed Badge

![Health badge](/badges/andersundsehr-server-send-events/health.svg)

```
[![Health](https://phpackages.com/badges/andersundsehr-server-send-events/health.svg)](https://phpackages.com/packages/andersundsehr-server-send-events)
```

###  Alternatives

[league/uri-interfaces

Common tools for parsing and resolving RFC3987/RFC3986 URI

538204.9M23](/packages/league-uri-interfaces)[neuron-core/neuron-ai

The PHP Agentic Framework.

1.8k245.3k20](/packages/neuron-core-neuron-ai)[simplesamlphp/saml2

SAML2 PHP library from SimpleSAMLphp

30317.2M40](/packages/simplesamlphp-saml2)[php-heroku-client/php-heroku-client

A PHP client for the Heroku Platform API

24404.8k4](/packages/php-heroku-client-php-heroku-client)[phpro/http-tools

HTTP tools for developing more consistent HTTP implementations.

28137.8k](/packages/phpro-http-tools)[iwechatpay/openapi

为 wechatpay/wechatpay 增加IDE提示的接口描述包。

406.7k](/packages/iwechatpay-openapi)

PHPackages © 2026

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