https://github.com/longrunning/core
[READ ONLY] LongRunning Core
https://github.com/longrunning/core
Last synced: 4 months ago
JSON representation
[READ ONLY] LongRunning Core
- Host: GitHub
- URL: https://github.com/longrunning/core
- Owner: LongRunning
- License: mit
- Created: 2020-12-01T19:11:37.000Z (about 5 years ago)
- Default Branch: main
- Last Pushed: 2021-12-22T08:07:23.000Z (about 4 years ago)
- Last Synced: 2025-09-16T23:04:16.385Z (5 months ago)
- Language: PHP
- Size: 22.5 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# LongRunning Core
This is a read only split from the [LongRunning](https://github.com/LongRunning/LongRunning) mono repository.
If you want to make changes, please create a pull request [there](https://github.com/LongRunning/LongRunning/pulls).
## Installation
```
composer require long-running/core
```
## Symfony
If you are using Symfony, make sure to enable the bundle:
```php
['all' => true],
];
```
## How to use?
```php
cleanUp();
}
```
If you are using Symfony, any service that implements the `LongRunning\Core\Cleaner` interface
will be autoconfigured and added to the `LongRunning\Core\DelegatingCleaner`.
The `LongRunning\Core\DelegatingCleaner` is aliased to `LongRunning\Core\Cleaner`.
That means that you can inject the `LongRunning\Core\Cleaner` service in your worker and it will
call all configured cleaners on `cleanUp()`:
```php
cleaner = $cleaner;
}
public function doWork() : void
{
while (true) {
// Do heavy work, like processing jobs from a queue
echo "Doing heavy work";
sleep(1);
echo "Done with heavy work";
// Cleanup things
$this->cleaner->cleanUp();
}
}
}
```
## Existing cleaners
LongRunning provides 2 packages that add additional cleaners:
* [doctrine-orm](https://github.com/LongRunning/doctrine-orm)
* [sentry](https://github.com/LongRunning/sentry)