class DRbQueue::Server::Work

Public Class Methods

unserialize(serialized) click to toggle source
# File lib/drb_queue/server.rb, line 22
def self.unserialize(serialized)
  hash = JSON.parse(serialized)
  worker = hash['worker'].split('::').inject(Object) { |o, k| o.const_get(k) }

  new(worker, hash['args'])
end

Public Instance Methods

perform() click to toggle source
# File lib/drb_queue/server.rb, line 18
def perform
  worker.perform(*args)
end
serialize() click to toggle source
# File lib/drb_queue/server.rb, line 29
def serialize
  {'worker' => worker.to_s, 'args' => args}.to_json
end