Module: Nagare::Publisher::ClassMethods

Defined in:
lib/nagare/publisher.rb

Overview

Class methods that get injected into a class or module that extends Publisher

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#redis_publisher_streamObject

Returns the value of attribute redis_publisher_stream.



12
13
14
# File 'lib/nagare/publisher.rb', line 12

def redis_publisher_stream
  @redis_publisher_stream
end

Instance Method Details

#stream(name) ⇒ Object

Defines which stream to use for publish when none is specified

The stream is automatically created by Redis if it doesn’t exist when a message is first published to it.

Defaults to the name of the class publishing the message

Parameters:

  • name (String)

    name of the stream



23
24
25
# File 'lib/nagare/publisher.rb', line 23

def stream(name)
  self.redis_publisher_stream = name.to_s
end