
Security News
New Website “Is It Really FOSS?” Tracks Transparency in Open Source Distribution Models
A new site reviews software projects to reveal if they’re truly FOSS, making complex licensing and distribution models easy to understand.
Instant queue. Background processing and message driven communication tool. Faster and simplier alternative to Resque.
Add this line to your application's Gemfile
:
gem 'insque'
And then execute:
$ bundle
Or install it manually:
$ gem install insque
At first you need to generate initializer and redis config file. Pass your sender name as parameter. Sender name is the unique identifier of your instance of insque. You can use several instances of insque to create message driven communication system.
$ rails g insque:initializer somesender
To broadcast message use:
Insque.broadcast :message_name, { params: { some: :param } }
There is an easy way to use insque as background jobs processing. You can use send_later
method to call any method of your rails models in background:
@model = MyModel.first
@model.send_later :mymethod, 'some', 'params'
You'll need a special slow listener running to make this work.
Insque.slow_listen
there is a matching slow janitor as well:
Insque.slow_janitor
To start recieving messages you need to:
Create handler method in Insque module. First part of handler name is the name of the message sender.
def somesender_message_name message
#TODO: Handle message somehow
end
Call listen
method in some background process or rake task:
Insque.listen
or just run bundle exec rake insque:listener
from your console.
Call janitor
method in some background process or rake task. Janitor will reissue failed messages or report error if message fails again. Janitor treats message as failed if it was not processed for an hour after broadcast or reissue.
Insque.janitor
or just run bundle exec rake insque:janitor
from your console.
There is a simple way to run all insque workers, both regular and slow in a single multi-threaded process:
bundle exec rake insque:run
To make insque run on Redis Cluster add this line to your application's Gemfile
:
gem 'redis_cluster'
and change redis.yml
file accordingly:
production:
- host: cluster_host1
port: 1234
- host: cluster_host2
port: 1234
- host: cluster_host3
port: 1234
If you want to run insque as a daemon consider using foreman for this.
If you deploy with capistrano you may want to try a version of foreman with build in capistrano support.
Add foreman to your Gemfile
:
gem 'foreman' # OR
gem 'foreman-capistrano'
Install it:
$ bundle install
Create Procfile
:
insque: bundle exec rake insque:run
Run foreman from your console:
$ bundle exec foreman start
For production use modify your capistrano deploy script somewhat like this:
set :default_environment, {'PATH' => "/sbin:$PATH"} # Optional. Useful if you get errors because start or restart command not found
set :foreman_concurrency, "\"insque=1\"" # How many processes of each type do you want
require 'foreman/capistrano'
after "deploy", "foreman:export" # Export Procfile as a set of upstart jobs
after "deploy", "foreman:restart" # You will need upstart installed on your server for this to work.
git checkout -b my-new-feature
)git commit -am 'Added some feature'
)git push origin my-new-feature
)FAQs
Unknown package
We found that insque 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
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.
Security News
The Latio podcast explores how static and runtime reachability help teams prioritize exploitable vulnerabilities and streamline AppSec workflows.