{"id":18746090,"url":"https://github.com/diloabininyeri/async","last_synced_at":"2026-02-17T23:02:02.044Z","repository":{"id":216923734,"uuid":"742740259","full_name":"diloabininyeri/async","owner":"diloabininyeri","description":"A library that can run objects async with PHP","archived":false,"fork":false,"pushed_at":"2024-01-13T10:47:55.000Z","size":8,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-19T22:42:24.390Z","etag":null,"topics":["async","concurency","mutex","mutex-lock","mutex-semaphore","paralelism","php"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/diloabininyeri.png","metadata":{"files":{"readme":"readme.MD","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2024-01-13T08:13:01.000Z","updated_at":"2024-05-07T02:08:26.000Z","dependencies_parsed_at":"2024-01-13T17:59:21.888Z","dependency_job_id":"20e1aada-2380-4c33-9a3c-898db6d24510","html_url":"https://github.com/diloabininyeri/async","commit_stats":null,"previous_names":["diloabininyeri/async"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/diloabininyeri/async","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/diloabininyeri%2Fasync","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/diloabininyeri%2Fasync/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/diloabininyeri%2Fasync/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/diloabininyeri%2Fasync/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/diloabininyeri","download_url":"https://codeload.github.com/diloabininyeri/async/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/diloabininyeri%2Fasync/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29561783,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-17T21:50:49.831Z","status":"ssl_error","status_checked_at":"2026-02-17T21:46:15.313Z","response_time":100,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["async","concurency","mutex","mutex-lock","mutex-semaphore","paralelism","php"],"created_at":"2024-11-07T16:20:52.068Z","updated_at":"2026-02-17T23:02:02.007Z","avatar_url":"https://github.com/diloabininyeri.png","language":"PHP","readme":"## Php async \nProvides async running objects with PHP via process spawn\n\nfor installation via composer \n```console\ncomposer require zeus/async:dev-main\n\n```\nphp test code \n```php\nuse Zeus\\Async\\AsyncProcess;\nuse Zeus\\Async\\test\\Sleep;\n\nrequire_once 'vendor/autoload.php';\n\n\n$asyncProcess = new AsyncProcess();\n$asyncProcess-\u003eadd(new Sleep(2));\n$asyncProcess-\u003eadd(new Sleep(1));\n$asyncProcess-\u003eadd(new Sleep(2));\n$asyncProcess-\u003eadd(new Sleep(1));\n$asyncProcess-\u003eadd(new Sleep(3));\n$asyncProcess-\u003eadd(new Sleep(1));\n$asyncProcess-\u003eadd(new Sleep(2));\n$asyncProcess-\u003eadd(new Sleep(2));\n$asyncProcess-\u003eadd(new Sleep(1));\n\n\necho 'app started';\n\n$asyncProcess-\u003estart();\n\necho 'app progressing';\n$asyncProcess-\u003ewait();\n\necho 'app is finished';\n\n\n```\n## Synchronous\nIf you want some objects to run in Sync, you can do this through the Mutex object.\n\n```php\n\nuse Zeus\\Async\\AsyncProcess;\nuse Zeus\\Async\\Mutex;\nuse Zeus\\Async\\test\\Sleep;\nuse Zeus\\Async\\test\\SleepSync;\n\nrequire_once 'vendor/autoload.php';\n\n\n$mutex = new Mutex();\n\n$asyncProcess = new AsyncProcess(7);\n\n$asyncProcess-\u003eadd(new SleepSync($mutex, 2));\n$asyncProcess-\u003eadd(new Sleep(1));\n$asyncProcess-\u003eadd(new SleepSync($mutex, 2));\n\n$asyncProcess-\u003estart();\n$asyncProcess-\u003ewait();\n```\n\n## Mutex\nIn critical transactions, some operations may need to wait for some operations, the best example of this is if two people try to buy a ticket at the same time, it will make one of them wait atomically.\n```php\n\n$mutex = new Mutex();\n\n$mutex-\u003elock();\n//critic operations \n$mutex-\u003eunlock();\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdiloabininyeri%2Fasync","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdiloabininyeri%2Fasync","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdiloabininyeri%2Fasync/lists"}