Using Sidekiq’s Redis Connections in Other Places

At Shareaholic we make heavy use of Sidekiq for background and asynchronous jobs. Because it uses threads it consumes far fewer resources than its most similar sibling, Resque, which uses a separate process for each job. We are able to run one Sidekiq process with 28 threads for each core on our worker machines. Sidekiq wraps all of its connections in a connection pool using the connection_pool gem as can be seen here. Sidekiq gives the user access to its connections to redis with the Sidekiq.redis method, to which you pass a block and are yielded a connection:

1
2
3
4
Sidekiq.redis do |connection|
  # get all the keys in redis
  connection.keys('*')
end
Read on →

Moving to Octopress

I used to host my blog on Tumblr because that seemed like an easy solution. But starting today I’m moving to Octopress because I actually think it’s even easier to use. Octopress fits better into my blog eriting workflow and appeals to my geeky side because I’m doing all of the hosting/deploying/what-have-you myself.

Read on →

Using Guard and Jasmine to Make CoffeeScript Testing Fast

When I’m developing in Ruby and Rails using RSpec, I have a mapping in my vim configuration for ,l that runs the current test in a separate tmux window. This is incredibly useful for testing early and often and doing TDD to the fullest. So when I started working my dominion app, which uses CoffeeScript and Backbone, I wanted to set up a similar system of quickly being able to run tests. Jasmine is one of the more widely used frameworks for testing JavaScript applications, and is heavily influenced by RSpec:

1
2
3
4
5
describe("A suite", function() {
  it("contains spec with an expectation", function() {
    expect(true).toBe(true);
  });
});
Read on →