Class: KubeMQ::PubSub::EventStoreReceived
- Inherits:
-
Object
- Object
- KubeMQ::PubSub::EventStoreReceived
- Defined in:
- lib/kubemq/pubsub/event_store_received.rb
Overview
A durable event received from an events store subscription.
Delivered to the block passed to KubeMQ::PubSubClient#subscribe_to_events_store. The #sequence value can be used to track replay position.
Instance Attribute Summary collapse
-
#body ⇒ String
readonly
Event payload (binary).
-
#channel ⇒ String
readonly
The channel the event was published to.
-
#id ⇒ String
readonly
Unique event identifier.
-
#metadata ⇒ String
readonly
Event metadata.
-
#sequence ⇒ Integer
readonly
Broker-assigned sequence number for replay tracking.
-
#tags ⇒ Object
readonly
Returns the value of attribute tags.
-
#timestamp ⇒ Integer
readonly
Broker-assigned timestamp (Unix nanoseconds).
Instance Method Summary collapse
-
#initialize(id:, channel:, metadata:, body:, timestamp:, sequence:, tags:) ⇒ EventStoreReceived
constructor
A new instance of EventStoreReceived.
Constructor Details
#initialize(id:, channel:, metadata:, body:, timestamp:, sequence:, tags:) ⇒ EventStoreReceived
Returns a new instance of EventStoreReceived.
36 37 38 39 40 41 42 43 44 |
# File 'lib/kubemq/pubsub/event_store_received.rb', line 36 def initialize(id:, channel:, metadata:, body:, timestamp:, sequence:, tags:) @id = id @channel = channel @metadata = @body = body @timestamp = @sequence = sequence @tags = || {} end |
Instance Attribute Details
#body ⇒ String (readonly)
Returns event payload (binary).
27 |
# File 'lib/kubemq/pubsub/event_store_received.rb', line 27 attr_reader :id, :channel, :metadata, :body, :timestamp, :sequence, :tags |
#channel ⇒ String (readonly)
Returns the channel the event was published to.
27 |
# File 'lib/kubemq/pubsub/event_store_received.rb', line 27 attr_reader :id, :channel, :metadata, :body, :timestamp, :sequence, :tags |
#id ⇒ String (readonly)
Returns unique event identifier.
27 28 29 |
# File 'lib/kubemq/pubsub/event_store_received.rb', line 27 def id @id end |
#metadata ⇒ String (readonly)
Returns event metadata.
27 |
# File 'lib/kubemq/pubsub/event_store_received.rb', line 27 attr_reader :id, :channel, :metadata, :body, :timestamp, :sequence, :tags |
#sequence ⇒ Integer (readonly)
Returns broker-assigned sequence number for replay tracking.
27 |
# File 'lib/kubemq/pubsub/event_store_received.rb', line 27 attr_reader :id, :channel, :metadata, :body, :timestamp, :sequence, :tags |
#tags ⇒ Object (readonly)
Returns the value of attribute tags.
27 |
# File 'lib/kubemq/pubsub/event_store_received.rb', line 27 attr_reader :id, :channel, :metadata, :body, :timestamp, :sequence, :tags |
#timestamp ⇒ Integer (readonly)
Returns broker-assigned timestamp (Unix nanoseconds).
27 |
# File 'lib/kubemq/pubsub/event_store_received.rb', line 27 attr_reader :id, :channel, :metadata, :body, :timestamp, :sequence, :tags |