{"id":20332424,"url":"https://github.com/zeroby0/deterministicprocesspool","last_synced_at":"2026-05-10T10:51:24.440Z","repository":{"id":175198149,"uuid":"364644698","full_name":"zeroby0/DeterministicProcessPool","owner":"zeroby0","description":"A simple Deteriministic ProcessPoolExcecutor for Python 3.7+","archived":false,"fork":false,"pushed_at":"2021-05-05T19:24:59.000Z","size":13,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-02-24T13:51:18.801Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"unlicense","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/zeroby0.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-05-05T16:45:02.000Z","updated_at":"2021-05-05T19:25:01.000Z","dependencies_parsed_at":null,"dependency_job_id":"376409ff-f998-4fde-b585-447b8e250e0b","html_url":"https://github.com/zeroby0/DeterministicProcessPool","commit_stats":null,"previous_names":["zeroby0/deterministicprocesspool"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zeroby0%2FDeterministicProcessPool","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zeroby0%2FDeterministicProcessPool/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zeroby0%2FDeterministicProcessPool/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zeroby0%2FDeterministicProcessPool/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zeroby0","download_url":"https://codeload.github.com/zeroby0/DeterministicProcessPool/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241851739,"owners_count":20030964,"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","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":"2024-11-14T20:26:33.105Z","updated_at":"2026-05-10T10:51:19.385Z","avatar_url":"https://github.com/zeroby0.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# DeterministicProcessPool\nA simple Deteriministic ProcessPoolExcecutor for Python 3.7+\n\nThe built-in ProcessPoolExecutor can wake processes in any order.\nThis one wakes them in the same order as they were submitted.\n\n### Installation\nDownload the `deterministic.py` file and keep it in the same folder as the file you're importing it from.\n\n### Usage\nHere is an example to make multiple webrequests with `wget`.\n\n```Python3\nimport time\nfrom deterministic import DeterministicPool, DeterministicTask\n\nclass Task(DeterministicTask):\n    def __init__(self, url):\n        self.url = url\n\n        self.command = [\n            # Change this to the command you wanna run\n            'wget', f'{url}'\n        ]\n    \n    def on_launch(self):\n        print(f'Started downloading {self.url}')\n\n    def on_success(self):\n        print(f'Completed downloading {self.url}')\n\n    def on_error(self):\n        print(f'Error downloading {self.url}')\n\n\nif __name__ == '__main__':\n\n    pool = DeterministicPool(max_concurrent=5)\n\n    urls = [...] # A list of URLs you want to wget\n    for url in urls:\n        pool.submit(\n            task = Task(\n                url\n            )\n        )\n\n    while pool.has_tasks():\n        pool.tick()\n        time.sleep(1)\n        # Call pool.tick() frequently so that the pool\n        # can check on the processes, and start new processes.\n```\n\nYou don't need to `submit` all the tasks before hand,\nyou can also do that while the pool is running.\n\nMaximum Concurrency of the pool can be increased, but cannot be decreased.\nIt should be trivial to implement that though, I might do that later.\n\n### License\n\nThis library and it's documentation are [Public Domain](./LICENSE). Go nuts.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzeroby0%2Fdeterministicprocesspool","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzeroby0%2Fdeterministicprocesspool","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzeroby0%2Fdeterministicprocesspool/lists"}