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(10mo ago)01.4k↓100%GPL-2.0-or-laterPHPPHP ~8.2.0 || ~8.3.0 || ~8.4.0CI passing

Since Jun 29Pushed 10mo 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 today

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 88% of packages

Maintenance54

Moderate activity, may be stable

Popularity19

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity64

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

304d 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)
```

PHPackages © 2026

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