https://github.com/asyncphp/remit
https://github.com/asyncphp/remit
Last synced: about 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/asyncphp/remit
- Owner: asyncphp
- License: other
- Created: 2015-03-10T08:02:11.000Z (about 11 years ago)
- Default Branch: 1.x
- Last Pushed: 2020-06-18T16:25:57.000Z (over 5 years ago)
- Last Synced: 2025-10-01T01:01:56.655Z (5 months ago)
- Language: PHP
- Size: 15.6 KB
- Stars: 62
- Watchers: 7
- Forks: 3
- Open Issues: 1
-
Metadata Files:
- Readme: readme.md
- Contributing: contributing.md
- License: license.md
- Code of conduct: code-of-conduct.md
Awesome Lists containing this project
README
# Remit
[](https://travis-ci.org/asyncphp/remit)
[](https://scrutinizer-ci.com/g/asyncphp/remit)
[](https://scrutinizer-ci.com/g/asyncphp/remit)
[](https://packagist.org/packages/asyncphp/remit)
[](license.md)
Distributed event emitter. Compatible from PHP `5.3` to PHP `7`.
## Usage
Listening for events:
```php
use AsyncPHP\Remit\Client\ZeroMqClient;
use AsyncPHP\Remit\Client\ZeroMqServer;
use AsyncPHP\Remit\Location\InMemoryLocation;
$server = new ZeroMqServer(new InMemoryLocation("127.0.0.1", 5555));
$server->addListener("my-event", function($param1, $param2) {
// ...do a thing
});
$client = new ZeroMqClient(new InMemoryLocation("127.0.0.1", 5555));
$this->client->emit("my-event", array("foo", "bar"));
```
You can find more in-depth documentation in [docs/en](docs/en/introduction.md).
## Motivation
This library provides a small, simple API for allowing bi-directional communication between processes, and across multiple servers. It's an event emitter, where the listeners can be in a different process, or on a different server to the code that emits events to them.
## Versioning
This library follows [Semver](http://semver.org). According to Semver, you will be able to upgrade to any minor or patch version of this library without any breaking changes to the public API. Semver also requires that we clearly define the public API for this library.
All methods, with `public` visibility, are part of the public API. All other methods are not part of the public API. Where possible, we'll try to keep `protected` methods backwards-compatible in minor/patch versions, but if you're overriding methods then please test your work before upgrading.
## Thanks
I'd like to thank [SilverStripe](http://www.silverstripe.com) for letting me work on fun projects like this. Feel free to talk to me about using the [framework and CMS](http://www.silverstripe.org) or [working at SilverStripe](http://www.silverstripe.com/who-we-are/#careers).