arquivei / events-sender
Applications events sender
Installs: 46 649
Dependents: 2
Suggesters: 0
Security: 0
Stars: 5
Watchers: 19
Forks: 4
Open Issues: 1
Requires
- php: ^7.3 || ^8.0 || ^8.2
- monolog/monolog: ^2.0 || ^3.0
- robinvdvleuten/ulid: ^4.0 || ^5.0
Requires (Dev)
- phpunit/phpunit: ^8.5
Suggests
- aws/aws-sdk-php: ^3.0
- google/cloud-pubsub: ^1.21
This package is auto-updated.
Last update: 2024-12-11 14:29:34 UTC
README
Applications events sender
Install
composer require arquivei/events-sender
Usage
Create your exporter and pass for Sender class
You can use the entities schemas:
<?php $exporter = new \Arquivei\Events\Sender\Exporters\File('filePath'); $sender = new \Arquivei\Events\Sender\Sender($exporter); /** * @param \Arquivei\Events\Sender\Schemas\ClassicSchema $schema * @param string $stream */ $sender->push($schema, $stream);
<?php $exporter = new \Arquivei\Events\Sender\Exporters\File('filePath'); $sender = new \Arquivei\Events\Sender\Sender($exporter); /** * @param \Arquivei\Events\Sender\Schemas\LatestSchema $schema * @param string $stream */ $sender->push($schema, $stream);
Or use the factories:
<?php $exporter = new \Arquivei\Events\Sender\Exporters\File('filePath'); $sender = new \Arquivei\Events\Sender\Sender($exporter); /** * @param \Arquivei\Events\Sender\Factories\LatestSchemaFactory $schema * @param string $stream */ $sender->push($schema, $stream);
<?php $exporter = new \Arquivei\Events\Sender\Exporters\File('filePath'); $sender = new \Arquivei\Events\Sender\Sender($exporter); /** * @param \Arquivei\Events\Sender\Factories\ClassicSchemaFactory $schema * @param string $stream */ $sender->push($schema, $stream);
Important
- Pass your exporters in order to, if the first one fails, the second be called.
- To call only one exporter configure only one of them.
Run Tests
$ vendor/phpunit/phpunit/phpunit tests