{"id":19863391,"url":"https://github.com/meowmeowahr/command_queue","last_synced_at":"2026-01-05T18:05:20.943Z","repository":{"id":250975972,"uuid":"836027419","full_name":"meowmeowahr/command_queue","owner":"meowmeowahr","description":"FIFO Queue for Functions","archived":false,"fork":false,"pushed_at":"2024-07-31T15:03:55.000Z","size":21,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-01-30T23:28:17.680Z","etag":null,"topics":["command","command-queue","fifo","fifo-queue","python","queue"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/meowmeowahr.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":"2024-07-31T02:44:04.000Z","updated_at":"2024-08-03T04:12:21.000Z","dependencies_parsed_at":"2024-07-31T05:23:07.759Z","dependency_job_id":null,"html_url":"https://github.com/meowmeowahr/command_queue","commit_stats":null,"previous_names":["meowmeowahr/command_queue"],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/meowmeowahr%2Fcommand_queue","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/meowmeowahr%2Fcommand_queue/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/meowmeowahr%2Fcommand_queue/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/meowmeowahr%2Fcommand_queue/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/meowmeowahr","download_url":"https://codeload.github.com/meowmeowahr/command_queue/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245573896,"owners_count":20637674,"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":["command","command-queue","fifo","fifo-queue","python","queue"],"created_at":"2024-11-12T15:14:30.699Z","updated_at":"2026-01-05T18:05:20.873Z","avatar_url":"https://github.com/meowmeowahr.png","language":"Python","readme":"# A Command Queue for Python\n\nRun commands (which can be regular functions) in a FIFO queue. Can be run in a background thread.\n\n## Usage examples\n\nSimple filling and running of the queue\n\n```python\nfrom command_queue import CommandQueue\nfrom command_queue.commands import FunctionCommand\nimport functools\n\n\nexample_queue = CommandQueue()\n\n# Add example commands\nfor i in range(100):\n    example_queue.add_command(\n        FunctionCommand(functools.partial(print, f\"Running loop iteration {i}\"))\n    )\n\n# Attempt to run command queue at 60 commands per second\n# Stop running once queue empties\nexample_queue.spin(60, until_empty=True)\n```\n\nExample of ParallelCommandGroups\n\n```python\nfrom command_queue import CommandQueue\nfrom command_queue.commands import FunctionCommand, ParallelCommandGroup\nimport functools\nimport time\n\n\ndef do_something():\n    print(f\"Something happended on {time.time()}\")\n    time.sleep(0.05)\n\n\ndef do_something_2():\n    print(f\"Something_2 happended on {time.time()}\")\n    time.sleep(0.05)\n\n\nexample_queue = CommandQueue()\n\n# Add example non-parallel commands\n# These commands will run sequentially\nfor i in range(2):\n    example_queue.add_command(FunctionCommand(functools.partial(do_something)))\n\n# These commands will run at the same time using threads\n\n# Add example parallel command\n# These commands will run at the same time\nexample_queue.add_command(\n    ParallelCommandGroup(\n        FunctionCommand(functools.partial(do_something_2)),\n        FunctionCommand(functools.partial(do_something_2)),\n        FunctionCommand(functools.partial(do_something_2)),\n        FunctionCommand(functools.partial(do_something_2)),\n        FunctionCommand(functools.partial(do_something_2)),\n        FunctionCommand(functools.partial(do_something_2)),\n    )\n)\n\n# Attempt to run command queue at 10 commands per second\n# Stop running once queue empties\nexample_queue.spin(10, until_empty=True)\n```","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmeowmeowahr%2Fcommand_queue","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmeowmeowahr%2Fcommand_queue","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmeowmeowahr%2Fcommand_queue/lists"}