Skip to content

Instantly share code, notes, and snippets.

/gist:1948268

Created Mar 1, 2012
Embed
What would you like to do?
module Ruote::Swf
#
# A parent class for DecisionWorker and ActivityWorker.
#
class SwfWorker < Ruote::Worker
def identity
@identity ||= "#{@name}-#{Socket.gethostname}-#{Ruote.local_ip}"
end
def shutdown
@running = false
@run_thread.terminate
end
end
#
# Just a nicer class name, to make it obvious we're using a decision
# worker.
#
class DecisionWorker < SwfWorker
end
#
# A worker whose name is 'activity worker'.
#
class ActivityWorker < SwfWorker
def initialize(worker_or_storage)
super('activity', worker_or_storage) end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.