{"id":15667635,"url":"https://github.com/rhumbertgz/elixir_qlib","last_synced_at":"2025-03-30T04:26:32.407Z","repository":{"id":62428986,"uuid":"70064281","full_name":"rhumbertgz/elixir_qlib","owner":"rhumbertgz","description":"A queue abstraction library to support leasing and buffering in Elixir.","archived":false,"fork":false,"pushed_at":"2016-10-10T07:27:29.000Z","size":18,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-06T07:35:46.395Z","etag":null,"topics":["elixir","lease","qlib","support-leasing"],"latest_commit_sha":null,"homepage":"","language":"Elixir","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rhumbertgz.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}},"created_at":"2016-10-05T13:42:24.000Z","updated_at":"2021-04-21T15:02:47.000Z","dependencies_parsed_at":"2022-11-01T20:02:12.305Z","dependency_job_id":null,"html_url":"https://github.com/rhumbertgz/elixir_qlib","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/rhumbertgz%2Felixir_qlib","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rhumbertgz%2Felixir_qlib/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rhumbertgz%2Felixir_qlib/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rhumbertgz%2Felixir_qlib/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rhumbertgz","download_url":"https://codeload.github.com/rhumbertgz/elixir_qlib/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246277209,"owners_count":20751542,"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":["elixir","lease","qlib","support-leasing"],"created_at":"2024-10-03T14:04:35.822Z","updated_at":"2025-03-30T04:26:32.382Z","avatar_url":"https://github.com/rhumbertgz.png","language":"Elixir","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Elixir Queue Lib (Qlib)\n\nA simple queue abstraction library to support leasing and buffering in Elixir.\nQLib provides two main queue abstractions LeasedQueue and BufferedQueue.\n\n## LeasedQueue\n\nLeasedQueue is a simple and leased abstraction around state.\n\nThe items stored in a LeasedQueue have a limited lifetime. The LeasedQueue sets a\nperiod time or lease time (by default 60 seconds) which is used to automatically\nremove expired items.\n\nAn item expires if its time (processing time) in the queue is greater than the leased\ntime specified by the queue. The processing time is the time when the item was\nstored in the queue.\n\nA LeasedQueue guarantees that a pop-call never will return an expired item.\n\nExample:\n```elixir\n{:ok, q} = LeasedQueue.new\nLeasedQueue.push(q, 1)\nLeasedQueue.pop(q)      \nLeasedQueue.size(q)\nLeasedQueue.clear(q)\nLeasedQueue.destroy(q)\n```\n## BufferedQueue\n\nBufferedQueue is a simple and buffered abstraction around state.\n\nA BufferedQueue can only store a N maximum of items. The size of BufferedQueue\nwill never exceed the N items. If a BufferedQueue achieve its maximum capacity\nand a new item has to be inserted, the collection automatically will remove its\noldest item.\n\nThe default capacity of BufferedQueue is 1000 items. The developers can set the\ncapacity value during the creation of the collection.\n\nExample:\n```elixir\n{:ok, q} = BufferedQueue.new 5000\nBufferedQueue.push(q, 1)\nBufferedQueue.pop(q)\nBufferedQueue.size(q)\nBufferedQueue.clear(q)\nBufferedQueue.destroy(q)\n```\n## Installation\n\nIf [available in Hex](https://hex.pm/packages/elixir_qlib), the package can be installed as:\n\n  1. Add `elixir_qlib` to your list of dependencies in `mix.exs`:\n\n    ```elixir\n    def deps do\n      [{:elixir_qlib, \"~\u003e 0.1.1\"}] \n    end\n    ```\n\n  2. Ensure `elixir_qlib` is started before your application:\n\n    ```elixir\n    def application do\n      [applications: [:elixir_qlib]]\n    end\n    ```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frhumbertgz%2Felixir_qlib","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frhumbertgz%2Felixir_qlib","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frhumbertgz%2Felixir_qlib/lists"}