Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/cspray/delivery-service

Abstraction to allow sending intra-process messages within an asynchronous event loop.
https://github.com/cspray/delivery-service

Last synced: about 1 month ago
JSON representation

Abstraction to allow sending intra-process messages within an asynchronous event loop.

Awesome Lists containing this project

README

        

# DeliveryService

A library to allow transmitting and receiving messages within an asynchronous event loop.
Includes a receipt that all listeners for a given messgae have read it.

This library primarily holds the interfaces designed to provide the discussed functionality
and generic implementations that are not dependent on any particular event reactor. For
functional implementations of these interfaces please check out:

- [`cspray/amp-delivery-service`](https://github.com/cspray/amp-delivery-service)

**This library requires PHP7! Because of this it will not be production ready until PHP7 is.**

## Overview

Here we talk about the interfaces that provide the messaging abstraction layer we place on
top of your favorite reactor. It is assumed from this point forward that you have a high-level
understanding of event loops, promises, and promisors.

### `Message`

Represents a type and a set of data that can be transmitted and received. In other words, a message.
The payload of the message can be whatever is appropriate for your domain.

```
$listenerReturnOrThrownException]

}}
```

### `Receiver`

Your code needs some way to receive messages; you accomplish this by adding a listener
for a specific type of Message to a Receiver.

```