{"id":20315264,"url":"https://github.com/sysread/coro-priorityqueue","last_synced_at":"2026-05-11T00:40:14.031Z","repository":{"id":12566272,"uuid":"15236724","full_name":"sysread/Coro-PriorityQueue","owner":"sysread","description":"A priority queue (heap) for Perl and Coro.","archived":false,"fork":false,"pushed_at":"2013-12-16T20:48:34.000Z","size":108,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-24T05:58:44.506Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Perl","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sysread.png","metadata":{"files":{"readme":"README","changelog":"Changes","contributing":null,"funding":null,"license":"COPYING","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2013-12-16T20:43:39.000Z","updated_at":"2014-09-09T14:50:48.000Z","dependencies_parsed_at":"2022-09-23T08:02:28.706Z","dependency_job_id":null,"html_url":"https://github.com/sysread/Coro-PriorityQueue","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sysread%2FCoro-PriorityQueue","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sysread%2FCoro-PriorityQueue/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sysread%2FCoro-PriorityQueue/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sysread%2FCoro-PriorityQueue/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sysread","download_url":"https://codeload.github.com/sysread/Coro-PriorityQueue/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241818872,"owners_count":20025210,"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-14T18:18:32.244Z","updated_at":"2026-05-11T00:40:13.984Z","avatar_url":"https://github.com/sysread.png","language":"Perl","funding_links":[],"categories":[],"sub_categories":[],"readme":"NAME\n    Coro::PriorityQueue\n\nSYNOPSIS\n        use Coro::PriorityQueue;\n        use Coro;\n\n        my $queue = Coro::PriorityQueue-\u003enew(10);\n\n        my $producer = async {\n            foreach my $i (1 .. 10) {\n                $queue-\u003einsert($i);\n            }\n\n            $queue-\u003eshutdown;\n        };\n\n        my $consumer = async {\n            while (1) {\n                my $i = $queue-\u003eremove or last;\n                printf(\"%d * 2 = %d\\n\", $i, $i * 2);\n            }\n        };\n\n        $producer-\u003ejoin, $consumer-\u003ejoin;\n\nDESCRIPTION\n    Priority queues automatically order their contents according to the\n    inserted item's priority. Calling code must ensure that their queue\n    items are comparable via this strategy (e.g. by overloading the \u003c=\u003e\n    operator).\n\n    Underneath, this is implemented as a simple array heap, using\n    Coro::Semaphore to control access.\n\nMETHODS\n  new($max)\n    Creates a new queue that can store $max items.\n\n  insert($item)\n    Inserts an item into the queue. Will block the thread until a slot is\n    available if necessary. If the queue has been shut down, croaks.\n\n    It is an error to insert undef into the queue.\n\n  remove\n    Removes and returns an item from the queue. Blocks until an item becomes\n    available if necessary. If the queue is shutdown, returns undefined\n    immediately.\n\n  count\n    Returns the number of items currently stored.\n\n  is_empty\n    Returns true if the queue is empty.\n\n  is_full\n    Returns true if the queue is full.\n\n  shutdown\n    Shuts down the queue, after which no items may be inserted. Items\n    already in the queue can be pulled normally until empty, after which\n    further calls to \"remove\" will return undefined.\n\nAUTHOR\n    Jeff Ober \u003cjeffober@gmail.com\u003e\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsysread%2Fcoro-priorityqueue","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsysread%2Fcoro-priorityqueue","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsysread%2Fcoro-priorityqueue/lists"}