Class: Hivent::AbstractSignal
- Inherits:
-
Object
- Object
- Hivent::AbstractSignal
- Defined in:
- lib/hivent/abstract_signal.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#client_id ⇒ Object
readonly
Returns the value of attribute client_id.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#producer ⇒ Object
readonly
Returns the value of attribute producer.
Instance Method Summary collapse
- #emit(payload, version:, cid: nil, key: nil) ⇒ Object
-
#initialize(name) ⇒ AbstractSignal
constructor
A new instance of AbstractSignal.
- #receive(version: nil, &block) ⇒ Object
Constructor Details
#initialize(name) ⇒ AbstractSignal
Returns a new instance of AbstractSignal.
8 9 10 11 12 |
# File 'lib/hivent/abstract_signal.rb', line 8 def initialize(name) @name = name @producer = nil @client_id = Hivent::Config.client_id end |
Instance Attribute Details
#client_id ⇒ Object (readonly)
Returns the value of attribute client_id.
6 7 8 |
# File 'lib/hivent/abstract_signal.rb', line 6 def client_id @client_id end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
6 7 8 |
# File 'lib/hivent/abstract_signal.rb', line 6 def name @name end |
#producer ⇒ Object (readonly)
Returns the value of attribute producer.
6 7 8 |
# File 'lib/hivent/abstract_signal.rb', line 6 def producer @producer end |
Instance Method Details
#emit(payload, version:, cid: nil, key: nil) ⇒ Object
14 15 16 17 18 |
# File 'lib/hivent/abstract_signal.rb', line 14 def emit(payload, version:, cid: nil, key: nil) (payload, cid, version).tap do || (, partition_key(key, ), version) end end |