Sha256: dceaf223bc14261d754e53b2ac0313e7ff8add2d215f8a09f64ddef31a2a96cf

Contents?: true

Size: 899 Bytes

Versions: 2

Compression:

Stored size: 899 Bytes

Contents

module AutomateEm

	class Service
		include ModuleCore
		
		def initialize
			@systems = []

			#
			# Status variables
			#	NOTE:: if changed then change in logic.rb 
			#
			@status = {}
			@status_lock = Object.new.extend(MonitorMixin)
			@system_lock = Mutex.new
			@status_waiting = false
		end
		
		protected
		
		def config
			ServiceModule.lookup(self)
		end
		
		def request(path, options = {}, *args, &block)
			error = true
			
			begin
				error = @base.do_send_request(path, options, *args, &block)
			rescue => e
				AutomateEm.print_error(logger, e, {
					:message => "module #{self.class} in request",
					:level => Logger::ERROR
				})
			ensure
				if error
					begin
						logger.warn "Request failed for: #{path.inspect}"
					rescue
						logger.error "Request failed, bad path data"
					end
				end
			end
			
		end
	end
	
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
automate-em-0.0.4 lib/automate-em/service/service.rb
automate-em-0.0.3 lib/automate-em/service/service.rb