{"id":13509033,"url":"https://github.com/falood/queuex","last_synced_at":"2025-04-09T18:24:43.028Z","repository":{"id":57538797,"uuid":"41851048","full_name":"falood/queuex","owner":"falood","description":"Elixir Priority Queue","archived":false,"fork":false,"pushed_at":"2017-01-10T15:33:36.000Z","size":16,"stargazers_count":11,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-23T20:24:44.176Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Elixir","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"wtfpl","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/falood.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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":"2015-09-03T09:09:54.000Z","updated_at":"2023-09-01T10:45:23.000Z","dependencies_parsed_at":"2022-09-19T07:30:52.113Z","dependency_job_id":null,"html_url":"https://github.com/falood/queuex","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/falood%2Fqueuex","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/falood%2Fqueuex/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/falood%2Fqueuex/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/falood%2Fqueuex/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/falood","download_url":"https://codeload.github.com/falood/queuex/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248086350,"owners_count":21045329,"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-08-01T02:01:02.058Z","updated_at":"2025-04-09T18:24:43.010Z","avatar_url":"https://github.com/falood.png","language":"Elixir","funding_links":[],"categories":["Queue"],"sub_categories":[],"readme":"Queuex\n======\n\n\u003e Queuex is a Priority Queue.\n\n[![Build Status](https://img.shields.io/travis/falood/queuex.svg?style=flat-square)](https://travis-ci.org/falood/queuex)\n[![Hex.pm Version](https://img.shields.io/hexpm/v/queuex.svg?style=flat-square)](https://hex.pm/packages/queuex)\n[![Hex.pm Downloads](https://img.shields.io/hexpm/dt/queuex.svg?style=flat-square)](https://hex.pm/packages/queuex)\n\n\nThese backends are supported:\n\n    1. List (Queuex.Backends.List)\n    2. Red-black tree (Queue.Backends.RedBlackTree)\n\n\n## Usage\n\n    1. Define your queue module.\n```elixir\ndefmodule MyQueue do\n  use Queuex,\n    max_num: 3,                 # (required, integer) max worker numbers\n    worker: :my_worker,         # (required, atom) callback function\n    backend:                    # (optional, Queuex.Backends.List(default) or Queuex.Backends.RedBlackTree) queue backend\n    default_priority: 1,        # (optional, integer, default: 1) default priority for \u0026MyQueue.push/1, smaller means high priority\n    unique: false               # (optional, true or false(default) or :strictly) duplication term is allowned in queue. false =\u003e don't check, true =\u003e check with `backend.has_value?/2`, :strictly =\u003e check with `backend.has_priority_value?/3`\n\n  def my_worker(term, _priority) do\n    :timer.sleep(10000)\n    term |\u003e IO.inspect\n  end\nend\n```\n\n    2. supervise your queue module\n\n```elixir\n[ MyQueue.child_spec\n  ... # your other supervisor or worker\n] |\u003e supervise strategy: :one_for_one\n```\n\n    3. push term to queue\n\n```elixir\nMyQueue.push(term, priority)\nMyQueue.push(term) # push term with default priority\n```\n\n## TODO\n- [ ] Benchmark\n- [ ] Document\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffalood%2Fqueuex","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffalood%2Fqueuex","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffalood%2Fqueuex/lists"}