https://github.com/morebec/orkestra-postgresql-timeout-storage
[READ ONLY] PostgreSQL Timeout Storage for Orkestra
https://github.com/morebec/orkestra-postgresql-timeout-storage
orkestra php postgresql scheduler timeout
Last synced: about 1 month ago
JSON representation
[READ ONLY] PostgreSQL Timeout Storage for Orkestra
- Host: GitHub
- URL: https://github.com/morebec/orkestra-postgresql-timeout-storage
- Owner: Morebec
- License: apache-2.0
- Created: 2021-04-21T01:08:57.000Z (about 5 years ago)
- Default Branch: 2.x
- Last Pushed: 2023-03-31T18:46:55.000Z (about 3 years ago)
- Last Synced: 2025-02-01T23:45:11.724Z (over 1 year ago)
- Topics: orkestra, php, postgresql, scheduler, timeout
- Language: PHP
- Homepage:
- Size: 22.5 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# PostgreSQL Timeout Storage
This component is an implementation of a TimeoutStorage from the [Messaging Component]()
using PostgreSQL.
## Installation
```shell
composer require orkestra-orkestra-postgresql-timeout-storage
```
## Usage
```php
use Morebec\Orkestra\PostgreSqlTimeoutStorage\PostgreSqlTimeoutStorage;
use Morebec\Orkestra\PostgreSqlTimeoutStorage\PostgreSqlTimeoutStorageConfiguration;
$connection = new DriverManaer([
'url' => '...'
], new Configuration());
$configuration = new PostgreSqlTimeoutStorageConfiguration();
$storage = new PostgreSqlTimeoutStorage($connection, $configuration);
```
### Configuration
The `PostgreSqlTimeoutStorageConfiguration` class is used to configure the behavior of the timeout storage.
You can for example change the polling interval according to the needs of the application developed.
> Usually PostgreSQL is capable of handling polling efficiently, but of course, it always adds
> a little more work on it. It is advised to set up the `pollingInterval` to the minimum frequency at which new Timeouts
> are added in your application.
## Testing
To run the tests execute the following command:
```shell
vendor/bin/phpunit tests/
```
It is required to have an instance of postgresql running with a password-less role `postgres` and a database named `postgres`.
To easily get this setup and running a `docker-compose` configuration file is available at the root of this project.
To run it simply execute the following command:
```shell
docker-compose up -d
```