Class: ZQ::Composer::RedisPublish

Inherits:
Object
  • Object
show all
Defined in:
lib/zq/composers/redis.rb

Instance Method Summary collapse

Constructor Details

#initialize(channel_name, client) ⇒ RedisPublish

Returns a new instance of RedisPublish.



4
5
6
7
# File 'lib/zq/composers/redis.rb', line 4

def initialize(channel_name, client)
  @channel_name = channel_name
  @client = client
end

Instance Method Details

#compose(raw_data, composite = nil) ⇒ Object



8
9
10
11
12
# File 'lib/zq/composers/redis.rb', line 8

def compose(raw_data, composite = nil)
  composite ||= raw_data
  @client.publish(@channel_name, composite)
  composite
end