{"id":20122833,"url":"https://github.com/freaky/closeable_queue","last_synced_at":"2025-08-05T08:29:15.860Z","repository":{"id":62555795,"uuid":"42141226","full_name":"Freaky/closeable_queue","owner":"Freaky","description":"A wrapper around Ruby's Queue and SizedQueue to add a #close method","archived":false,"fork":false,"pushed_at":"2017-04-12T01:00:42.000Z","size":9,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-01-13T07:32:05.597Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Ruby","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/Freaky.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-09-08T21:57:41.000Z","updated_at":"2017-04-12T00:55:56.000Z","dependencies_parsed_at":"2022-11-03T05:31:18.822Z","dependency_job_id":null,"html_url":"https://github.com/Freaky/closeable_queue","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Freaky%2Fcloseable_queue","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Freaky%2Fcloseable_queue/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Freaky%2Fcloseable_queue/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Freaky%2Fcloseable_queue/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Freaky","download_url":"https://codeload.github.com/Freaky/closeable_queue/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241566163,"owners_count":19983258,"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-13T19:41:24.047Z","updated_at":"2025-03-02T20:25:51.879Z","avatar_url":"https://github.com/Freaky.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# CloseableQueue\n\nWrapper around Queue and SizedQueue adding a `#close` method.\n\nClosed queues allow `#pop` until the queue is drained, then forever return nil\nor raise StopIteration.  Pushes to a closed queue also raise an exception.\n\nRuby 2.3 is expected to support a native `#close` method which works similarly:\n\n  https://bugs.ruby-lang.org/issues/10600\n\n## Installation\n\nAdd this line to your application's Gemfile:\n\n```ruby\ngem 'closeable_queue'\n```\n\nAnd then execute:\n\n    $ bundle\n\nOr install it yourself as:\n\n    $ gem install closeable_queue\n\n## Usage\n\n```ruby\nqueue = CloseableQueue.new\nqueue.push(an_object) # =\u003e queue\nqueue.pop             # =\u003e an_object\nqueue.close\nqueue.pop             # =\u003e nil\nqueue.close(true)\nqueue.pop             # =\u003e raises CloseableQueue::ClosedQueue (is_a? StopIteration)\n```\n\n## Development\n\nAfter checking out the repo, run `bin/setup` to install dependencies. Then, run `rake test` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.\n\nTo install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).\n\n## Contributing\n\nBug reports and pull requests are welcome on GitHub at https://github.com/Freaky/closeable_queue\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffreaky%2Fcloseable_queue","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffreaky%2Fcloseable_queue","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffreaky%2Fcloseable_queue/lists"}