Sha256: b272fac209aee0691a0ee67617dedb6c3ebfecdc807028bd4f7670fb9e2f4bfb

Contents?: true

Size: 1.09 KB

Versions: 2

Compression:

Stored size: 1.09 KB

Contents

#
# Copyright (c) 2011-2017 Cloudware S.A. All rights reserved.
#
# This file is part of sp-job.
#
# sp-job is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# sp-job is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with sp-job.  If not, see <http://www.gnu.org/licenses/>.
#
# encoding: utf-8
#
module SP
  module Job

    class Worker < Backburner::Workers::Simple

      def start
        prepare
        loop do 
          work_one_job
          unless connection.connected?
            log_error "Connection to beanstalk closed, exiting now"
            Kernel.exit
          end
        end
      end

    end # Worker
  end # Module Job
end # Module SP

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
sp-job-0.2.3 lib/sp/job/worker.rb
sp-job-0.2.2 lib/sp/job/worker.rb