This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'queue_classic' | |
require 'typhoeus' | |
trap('INT') { exit } | |
trap('TERM') { worker.stop } | |
# Generic consumer | |
class TyphoeusConcurrentJob |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This code is demonstrating a default queue_classic worker. | |
# The biggest issue is, that requests made by its jobs are blocking | |
require 'rubygems' | |
require 'queue_classic' | |
require 'typhoeus' | |
trap('INT') { exit } | |
trap('TERM') { worker.stop } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# List of environments and their heroku git remotes (id: 'remote_name') | |
HEROKU_ENVIRONMENTS = { | |
staging: 'staging-remote-name', | |
production: 'production-remote-name' | |
} | |
namespace :deploy do | |
# Create rake tasks to deploy on Heroku environments | |
# $ rake -T deploy | |
# rake deploy:production # Deploy to production |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Please have a look, how updated_at timestamp is represented in generated SQL | |
# In this example everything is OK | |
Event.where(Sequel.expr(:updated_at) > Time.at(1405338941.821000)).sql | |
# => "SELECT * FROM \"events\" WHERE (\"updated_at\" > '2014-07-14 13:55:41.821000+0200')" | |
# In this example, there's a precision issue (see microseconds), why? | |
Event.where(Sequel.expr(:updated_at) > Time.at(1405341161.918000)).sql | |
# => "SELECT * FROM \"events\" WHERE (\"updated_at\" > '2014-07-14 14:32:41.917999+0200')" |
OlderNewer