Skip to content

Instantly share code, notes, and snippets.

Created March 1, 2012 08:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/1948268 to your computer and use it in GitHub Desktop.
Save anonymous/1948268 to your computer and use it in GitHub Desktop.
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