aerogram / adapter
Adaoter interfaces for aerogram messaging framework.
This package's canonical repository appears to be gone and the package has been frozen as a result.
0.2.1
2017-02-28 14:56 UTC
Requires
- php: ^7.1
- aerogram/message: ~0.1
Requires (Dev)
- phpunit/phpunit: ^6.0
This package is auto-updated.
Last update: 2020-11-20 11:23:45 UTC
README
Adaoter interfaces for aerogram messaging framework.
Installation
Install Composer and run the following command to get the latest version:
composer install aerogram/adapter
Usage
<?php use Aerogram\Adapter\Memory\MemoryPubSub; use Aerogram\Message\MessageFactory; $factory = new MessageFactory; $adapter = new MemoryPubSub; $message = $factory->create(json_encode(['email' => 'john@example.com']), ['topic' => 'user.registered']); $adapter->publish($message);
Usage with event-bus:
<?php use Aerogram\Adapter\Memory\MemoryPubSub; use Aerogram\EventBus\EventBus\SimpleBus; $adapter = new MemoryPubSub; $eventBus = new SimpleBus($adapter); $eventBus->publish('{"email": "john@example.com"}', 'user.registered');