Class: Airbrush::Server

Inherits:
Object show all
Defined in:
lib/airbrush/server.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(context = {}) ⇒ Server

Returns a new instance of Server.



5
6
7
8
9
10
11
12
13
# File 'lib/airbrush/server.rb', line 5

def initialize(context = {})
  memcache_host = context[:memcache]
  memcache_poll = context[:frequency]
  Object.send :__create_logger__, context[:log_target] if context.include? :log_target
  log.level = context[:verbose] ? ActiveSupport::BufferedLogger::Severity::DEBUG : ActiveSupport::BufferedLogger::Severity::INFO

  @listener = Airbrush::Listeners::Memcache.new(memcache_host, memcache_poll)
  @listener.handler = Handler.new(Processors::Image::Rmagick.new, Publishers::Memcache.new(memcache_host))
end

Instance Attribute Details

#listenerObject (readonly)

Returns the value of attribute listener.



3
4
5
# File 'lib/airbrush/server.rb', line 3

def listener
  @listener
end

Instance Method Details

#startObject



15
16
17
# File 'lib/airbrush/server.rb', line 15

def start
  @listener.start
end