{"id":31802898,"url":"https://github.com/longrunning/core","last_synced_at":"2025-10-11T00:56:50.820Z","repository":{"id":57015549,"uuid":"317642283","full_name":"LongRunning/core","owner":"LongRunning","description":"[READ ONLY] LongRunning Core","archived":false,"fork":false,"pushed_at":"2021-12-22T08:07:23.000Z","size":23,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-09-16T23:04:16.385Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/LongRunning.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-12-01T19:11:37.000Z","updated_at":"2023-11-29T14:59:25.000Z","dependencies_parsed_at":"2022-08-22T09:31:43.720Z","dependency_job_id":null,"html_url":"https://github.com/LongRunning/core","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/LongRunning/core","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LongRunning%2Fcore","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LongRunning%2Fcore/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LongRunning%2Fcore/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LongRunning%2Fcore/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/LongRunning","download_url":"https://codeload.github.com/LongRunning/core/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LongRunning%2Fcore/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279005648,"owners_count":26083942,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-10T02:00:06.843Z","response_time":62,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-10-11T00:56:32.591Z","updated_at":"2025-10-11T00:56:50.812Z","avatar_url":"https://github.com/LongRunning.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# LongRunning Core\n\nThis is a read only split from the [LongRunning](https://github.com/LongRunning/LongRunning) mono repository.\n\nIf you want to make changes, please create a pull request [there](https://github.com/LongRunning/LongRunning/pulls).\n\n## Installation\n\n```\ncomposer require long-running/core\n```\n\n## Symfony\n\nIf you are using Symfony, make sure to enable the bundle:\n```php\n\u003c?php\n// config/bundles.php\n\nreturn [\n    // ...\n    LongRunning\\Core\\Bundle\\LongRunningBundle::class =\u003e ['all' =\u003e true],\n];\n```\n\n## How to use?\n\n```php\n\u003c?php\n\nfinal class MyCleaner implements \\LongRunning\\Core\\Cleaner\n{\n    public function cleanUp() : void\n    {\n        echo \"Cleaning up memory!\";\n    }\n}\n\n$cleaner = new \\LongRunning\\Core\\DelegatingCleaner([\n    new MyCleaner(),\n]);\n\nwhile (true) {\n    // Do heavy work, like processing jobs from a queue\n    echo \"Doing heavy work\";\n    sleep(1);\n    echo \"Done with heavy work\";\n\n    // Cleanup things\n    $cleaner-\u003ecleanUp();\n}\n```\n\nIf you are using Symfony, any service that implements the `LongRunning\\Core\\Cleaner` interface\nwill be autoconfigured and added to the `LongRunning\\Core\\DelegatingCleaner`.\n\nThe `LongRunning\\Core\\DelegatingCleaner` is aliased to `LongRunning\\Core\\Cleaner`.\n\nThat means that you can inject the `LongRunning\\Core\\Cleaner` service in your worker and it will\ncall all configured cleaners on `cleanUp()`:\n```php\n\u003c?php\n\nnamespace App;\n\nuse LongRunning\\Core\\Cleaner;\n\nfinal class Worker\n{\n    private Cleaner $cleaner;\n\n    public function __construct(Cleaner $cleaner)\n    {\n        $this-\u003ecleaner = $cleaner;\n    }\n\n    public function doWork() : void\n    {\n        while (true) {\n            // Do heavy work, like processing jobs from a queue\n            echo \"Doing heavy work\";\n            sleep(1);\n            echo \"Done with heavy work\";\n\n            // Cleanup things\n            $this-\u003ecleaner-\u003ecleanUp();\n        }\n    }\n}\n```\n\n## Existing cleaners\n\nLongRunning provides 2 packages that add additional cleaners:\n\n* [doctrine-orm](https://github.com/LongRunning/doctrine-orm)\n* [sentry](https://github.com/LongRunning/sentry)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flongrunning%2Fcore","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flongrunning%2Fcore","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flongrunning%2Fcore/lists"}