{"id":13507163,"url":"https://github.com/joekain/BlockingQueue","last_synced_at":"2025-03-30T07:32:18.985Z","repository":{"id":33732563,"uuid":"37387062","full_name":"joekain/BlockingQueue","owner":"joekain","description":"A blocking queue written in Elixir.","archived":false,"fork":false,"pushed_at":"2023-07-07T16:14:19.000Z","size":33,"stargazers_count":52,"open_issues_count":2,"forks_count":12,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-09-26T08:18:05.561Z","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":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/joekain.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":"2015-06-13T20:40:23.000Z","updated_at":"2024-07-01T21:52:33.000Z","dependencies_parsed_at":"2024-06-21T14:06:59.506Z","dependency_job_id":"111dd5bc-8bc4-49e3-951f-eebe076e9bbf","html_url":"https://github.com/joekain/BlockingQueue","commit_stats":{"total_commits":43,"total_committers":6,"mean_commits":7.166666666666667,"dds":0.2325581395348837,"last_synced_commit":"e1672dbc2f50110d10c841f96ddd680091ecb199"},"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joekain%2FBlockingQueue","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joekain%2FBlockingQueue/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joekain%2FBlockingQueue/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joekain%2FBlockingQueue/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/joekain","download_url":"https://codeload.github.com/joekain/BlockingQueue/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":222021742,"owners_count":16917573,"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:00:25.660Z","updated_at":"2024-11-01T06:31:30.367Z","avatar_url":"https://github.com/joekain.png","language":"Elixir","funding_links":[],"categories":["Algorithms and Data structures"],"sub_categories":[],"readme":"BlockingQueue\n=============\n\n[![Build Status](https://semaphoreci.com/api/v1/projects/019de5e9-689e-4c1c-b5ba-3242e44ab483/455080/badge.svg)](https://semaphoreci.com/joekain/blockingqueue) [![Inline docs](http://inch-ci.org/github/joekain/BlockingQueue.svg?branch=master)](http://inch-ci.org/github/joekain/BlockingQueue)\n\nBlockingQueue is a simple queue implemented as a GenServer.  It has a fixed\nmaximum length established when it is created.\n\nThe queue is designed to decouple, but limit, the latency between a producer and\nconsumer.  When pushing to a full queue the `push` operation blocks\npreventing the producer from making progress until the consumer catches up.\nLikewise, when calling `pop` on an empty queue the call blocks until there\nis work to do.\n\n## Installation\n\nAdd a dependency in your mix.exs:\n\n```elixir\ndeps: [{:blocking_queue, \"~\u003e 1.0\"}]\n```\n\n## Examples\n\nA simple example:\n\n```elixir\n{:ok, pid} = BlockingQueue.start_link(5)\nBlockingQueue.push(pid, \"Hi\")\nBlockingQueue.pop(pid) # should return \"Hi\"\n```\n\nThe queue is designed to be used from more complex examples in which the\nproducer and consumer are in separate processes and run asynchronously to each\nother.\n\nAn example of an infinite stream:\n```elixir\n{:ok, pid} = BlockingQueue.start_link(:infinity)\nBlockingQueue.push(pid, \"Hi\")\nBlockingQueue.pop(pid) # should return \"Hi\"\n```\n\nAn example using the `Stream` API\n\n```elixir\n{:ok, pid} = BlockingQueue.start_link(5)\n\n[1, 2, 3]\n|\u003e BlockingQueue.push_stream(pid)\n\nBlockingQueue.pop_stream(pid)\n|\u003e Enum.take(3)  # Should return [1, 2, 3]\n```\n\n## Contribute\n\nJust fork the repo, make your change, and send me a pull request.\n\nOr, feel free to file and issue and start a discussion about a new feature you have in mind.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjoekain%2FBlockingQueue","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjoekain%2FBlockingQueue","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjoekain%2FBlockingQueue/lists"}