Class: Airbrush::Publishers::Memcache

Inherits:
Publisher show all
Defined in:
lib/airbrush/publishers/memcache.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(host) ⇒ Memcache

Returns a new instance of Memcache.



8
9
10
# File 'lib/airbrush/publishers/memcache.rb', line 8

def initialize(host)
  @host = host
end

Instance Attribute Details

#hostObject (readonly)

Returns the value of attribute host.



6
7
8
# File 'lib/airbrush/publishers/memcache.rb', line 6

def host
  @host
end

Instance Method Details

#publish(id, results) ⇒ Object



12
13
14
15
16
17
18
19
# File 'lib/airbrush/publishers/memcache.rb', line 12

def publish(id, results)
  # need to calculate an outboue queue name somehow, client will also need this to get the results
  name = unique_name(id)
  queue = MemCache.new(@host)
  queue.set(name, results)
  
  log.debug "Published results from #{name}"
end