
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.
http_resque helps you cleanly write integration tests for your Resque jobs. It's a thin HTTP API around the Resque daemon. With it you can manipulate the contents of the Resque queues using HTTP requests.
This is a key ingredient for writing off-box integration tests for your background jobs. In addition to inspecting and clearing queues, you can run a Resque job synchronously. This allows you to test that your background jobs are working by making HTTP requests, which is the same simple way you'd test a running webapp or a RESTful API server.
Making your background jobs easier to integration test is important -- background jobs are prone to failure because they run in the background, and frequently have environment-related bugs in production. Unit tests usually aren't good enough.
gem install http_resque
QUEUE=* http_resque
or if you use Bundler:
QUEUE=* bundle exec http_resque
Optional command line arguments:
$ http_resque -h
-p: the port to listen on. Defaults to the $PORT environment variable, or 4568.
--rakefile: the location of your Rakefile. The default is "./Rakefile".
When run, http_resque starts a small web server and then invokes rake resque:work
in a fork.
Once the http_resque server is started, you can access these URLs to manipulate your background jobs:
Lists all jobs in the queue named "queue_name", oldest first.
$ curl localhost:4568/queues/my_test_queue/jobs
Response:
[
{ "class" => "EmailComment", "args" => ["jack_sparrow@pirates.net"] },
...
]
Deletes all jobs in the given queue.
$ curl -X DELETE localhost:4568/queues/my_test_queue/jobs
Create a new background job. The body of the request should be in JSON and include "class" and "arguments".
$ curl -X POST localhost:4568/queues/my_test_queue/jobs \
-d '{ "class": "EmailComment", "arguments":["jack_sparrow@pirates.net"] }'
Runs the oldest job on the given queue, and does not return until it's finished. If there was a problem running the job (like the job threw a Ruby exception), this will return a 500 status code with the exception details.
$ curl localhost:4568/queues/my_test_queue/result_of_oldest_job
A response with a status of:
200 if successful.
404 if there are no jobs in this queue.
500 if there was an error running the job.
For further details, look at the web server's code in bin/http_resque. The code is shorter than this README.
http_resque is pretty small and limited as is. If you need more CLI options or a different set of REST APIs, file an issue or send a pull request.
When editing this gem, to test your changes, you can load your local copy of the gem in your project by using this in your Gemfile:
gem "http_resque", :path => "~/path/to/http_resque"
remote_http_testing - a small library for making remote HTTP requests and response assertions in tests.
FAQs
Unknown package
We found that http_resque 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.