Skip to content

Instantly share code, notes, and snippets.

View jmettraux's full-sized avatar

John Mettraux jmettraux

View GitHub Profile
# The context will call this method for each msg sucessfully processed
# by the worker.
#
def on_msg(msg)
puts(fancy_print(msg, @noisy)) if @noisy
return if msg['action'] == 'noop'
@on_msg_mutex.synchronize do
@jmettraux
jmettraux / .gitignore
Created March 27, 2012 20:17 — forked from netinlet/json_decode_error.rb
json decode error
*.swp
jmettraux@sanma $ date; bx rake swf:executions_and_tasks
Thu Mar 1 13:32:50 JST 2012
WFTYPE VER START WFID RUNID STC ODT OAT OT
my_workflow 0.1b 2012-03-01 04:31:24 UTC 20120301-1331-bipihosa-mopoyu ce51e5d5-d88a-4cfe-b19f-70fc9f1c97e0 5 0 1 0
count: 1
require 'rexml/document'
require 'pp'
require 'rubygems'
require 'ruote'
engine = Ruote::Engine.new(Ruote::Worker.new(Ruote::HashStorage.new()))
class FetchData
include Ruote::LocalParticipant
@jmettraux
jmettraux / t.rb
Created September 22, 2011 00:32
define 'error_handler' do
_if "${v:x} == 'y'" do
error "something went wrong"
# else
participant 'admin'
end
# works fine
foreach concurrence ..., task: y
end
# conflict
concurrence
foreach concurrence ..., task: x
# works fine
foreach concurrence ... task: y
end
# conflict
concurrence
foreach concurrence ... task: x
jmettraux@sanma ~/r/right_site (master) 円 ak "require .thread"
config/environment.rb
4: require 'thread'
No such file or directory - public/rightscale_core_ui
Rakefile
5: require 'thread'
vendor/plugins/activerecord-activesalesforce-adapter/lib/active_record/connection_adapters/activesalesforce_adapter.rb
# master.rb
#$:.unshift('~/w/ruote/lib')
#$:.unshift('~/w/ruote-redis/lib')
require 'rubygems'
require 'rufus-json/automatic'
require 'ruote'
require 'redis'