
Security News
Oxlint Introduces Type-Aware Linting Preview
Oxlint’s new preview brings type-aware linting powered by typescript-go, combining advanced TypeScript rules with native-speed performance.
ThrottledQueue is just like an EM::Queue, but will pop items off itself at a pace specified by you.
NOTE: Version v1.0.0 and v1.0.1 has an unintentional flaw, and should not be used.
NOTE: I personally won’t be doing any development on this library, but I will accept pull requests. If you want take over maintenance of this library for further development, please do contact me.
require 'em/throttled_queue'
# Example code that will pop off 2 items in total within a period of
# one second. The other items are not popped because of throttle.
EM::run do
# Create a queue that will pop off maximum of 2 items per second.
queue = EM::ThrottledQueue.new(2)
queue.push 1 # you can push one item at a time
queue.push 2, 3, 4, 5, 6 # or several at once
5.times { queue.pop(&EM::Callback(Object, :puts)) }
EM::add_timer(1) { EM::stop }
end
# Output:
# 1
# 2
gem install em-throttled_queue
Fork, write tests, add your code and send a pull request. If you modify existing files, please adhere to the coding standard surrounding your code. If you wish to report an issue, please use the GitHub issue tracker. I can also be contacted by mail (visible on my GitHub user page).
Development dependencies are specified in the gem specification, and can be installed using rubygems.
gem install em-throttled_queue --development
There’s also a Gemfile in the repository, allowing you to install dependencies via bundler.
bundle install
There currently is no reason for me to do so. If you believe there is, file an issue.
FAQs
Unknown package
We found that em-throttled_queue demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Oxlint’s new preview brings type-aware linting powered by typescript-go, combining advanced TypeScript rules with native-speed performance.
Security News
A new site reviews software projects to reveal if they’re truly FOSS, making complex licensing and distribution models easy to understand.
Security News
Astral unveils pyx, a Python-native package registry in beta, designed to speed installs, enhance security, and integrate deeply with uv.