Sha256: 9f7755af168e92769b304ea48345682ce0f0a81b09a635c163237b6af547a024

Contents?: true

Size: 699 Bytes

Versions: 16

Compression:

Stored size: 699 Bytes

Contents

module MKIt
  class ServiceWorker < AWorker

    def topics
      %w{start_service stop_service update_service delete_service}
    end

    def do_the(job)
      MKItLogger.info("#{self.class} <#{job.topic}> job #{job.inspect}....")
      srv = Service.find(job.service_id)
      case job.topic.to_sym
      when :start_service
        srv.start
      when :stop_service
        srv.stop
      when :update_service
        MKItLogger.info("#{self.class} <#{job.topic}> <<TODO>> job #{job.inspect}....")
      when :delete_service
        Service.destroy(job.service_id)
      else
        MKItLogger.info("#{self.class} <#{job.topic}> <<TODO>> job #{job.inspect}....")
      end
    end

  end
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
mkit-0.9.0 lib/mkit/workers/service_worker.rb
mkit-0.8.0 lib/mkit/workers/service_worker.rb
mkit-0.7.2 lib/mkit/workers/service_worker.rb
mkit-0.7.1 lib/mkit/workers/service_worker.rb
mkit-0.7.0 lib/mkit/workers/service_worker.rb
mkit-0.6.3 lib/mkit/workers/service_worker.rb
mkit-0.6.2 lib/mkit/workers/service_worker.rb
mkit-0.6.1 lib/mkit/workers/service_worker.rb
mkit-0.6.0 lib/mkit/workers/service_worker.rb
mkit-0.5.0 lib/mkit/workers/service_worker.rb
mkit-0.4.3 lib/mkit/workers/service_worker.rb
mkit-0.4.2 lib/mkit/workers/service_worker.rb
mkit-0.4.1 lib/mkit/workers/service_worker.rb
mkit-0.4.0 lib/mkit/workers/service_worker.rb
mkit-0.3.0 lib/mkit/workers/service_worker.rb
mkit-0.2.0 lib/mkit/workers/service_worker.rb