Bio
Jacob is the world's foremost expert on (within the subset of people who: work in Ruby for a living, surf the Pacific regularly, and brew sour beers). He does all these things in San Francisco California, while working at Engine Yard.
title
class SimpleViz | |
def initialize(app, &lookup) | |
@app = app | |
end | |
def call(env) | |
puts caller | |
request = Rack::Request.new(env) | |
puts "-> #{request.request_method.upcase} (#{request.url})" | |
status, headers, body = @app.call(env) | |
puts "<--#{status}-- #{body.size}" |
ERROR: no command given | |
Usage: test_worker <command> <options> -- <application options> | |
* where <command> is one of: | |
start start an instance of the application | |
stop stop all instances of the application | |
restart stop all instances and restart them afterwards | |
run start the application and stay on top | |
zap set the application to a stopped state |
class TrapLoop | |
trap('TERM') { stop! } | |
trap('INT') { stop! } | |
trap('SIGTERM') { stop! } | |
def self.stop! | |
@loop = false | |
end | |
def self.safe_exit_point! |
require 'celluloid' | |
class DiCaprio | |
include Celluloid | |
def do_a_thing | |
puts "starting" | |
`sleep 1` | |
puts "finished" | |
end |
#Save this file as hax_background_jobs_with_celluloid.ru | |
#In one terminal run: rackup hax_background_jobs_with_celluloid.ru | |
#In another run: curl -v localhost:9292 | |
require 'celluloid' | |
class CleverMailSender | |
class Sender | |
include Celluloid | |
def send_email(email) |
#Save this file as hax_background_jobs_with_threads.ru | |
#In one terminal run: rackup hax_background_jobs_with_threads.ru | |
#In another run: curl -v localhost:9292 | |
class CleverMailSender | |
def self.send_email(email) | |
Thread.new do | |
puts "sending e-mail: #{email}" | |
5.times{|x| puts x; sleep 0.5} | |
puts "sent" |
#Save this file as hax_background_jobs_in_unicorn.ru | |
#In one terminal run: unicorn hax_background_jobs_in_unicorn.ru | |
#In another run: curl -v localhost:8080 | |
class CleverMailSender | |
class << self; attr_accessor :emails_to_send; end | |
self.emails_to_send = [] | |
class BodyProxy | |
def initialize(body) | |
@body = body |
#Save this file as hax_background_jobs_in_thin.ru | |
#In one terminal run: thin start --rackup hax_background_jobs_in_thin.ru | |
#In another run: curl -v localhost:3000 | |
class CleverMailSender | |
class << self; attr_accessor :emails_to_send; end | |
self.emails_to_send = [] | |
def initialize(app) | |
@app = app | |
end |
Adambräu | |
Lindemans Framboise | |
Harpoon Raspberry UFO | |
Sam Adams Boston Lager (but only at Fenway Park) | |
Cuvée des Jacobins | |
Allagash White | |
Schneider Aventinus | |
Smithwick's | |
La Chouffe | |
Magic Hat Circus Boy |
Bio
Jacob is the world's foremost expert on (within the subset of people who: work in Ruby for a living, surf the Pacific regularly, and brew sour beers). He does all these things in San Francisco California, while working at Engine Yard.
title