Class: KubeMQ::PubSub::EventsStoreSubscription
- Inherits:
-
Object
- Object
- KubeMQ::PubSub::EventsStoreSubscription
- Defined in:
- lib/kubemq/pubsub/events_store_subscription.rb
Overview
Configuration for subscribing to durable events store channels.
Unlike EventsSubscription, events store subscriptions support replay from a historical position. Pass to KubeMQ::PubSubClient#subscribe_to_events_store with a block to receive EventStoreReceived messages.
Instance Attribute Summary collapse
-
#channel ⇒ String
Channel name to subscribe to.
-
#group ⇒ String?
Consumer group for load-balanced delivery.
-
#start_position ⇒ Integer
One of the EventStoreStartPosition constants.
-
#start_position_value ⇒ Integer
Sequence number, Unix timestamp, or delta depending on
start_position.
Instance Method Summary collapse
-
#initialize(channel:, start_position:, start_position_value: 0, group: nil) ⇒ EventsStoreSubscription
constructor
A new instance of EventsStoreSubscription.
-
#subscribe_type ⇒ Integer
private
Returns the subscribe type constant for the transport layer.
Constructor Details
#initialize(channel:, start_position:, start_position_value: 0, group: nil) ⇒ EventsStoreSubscription
Returns a new instance of EventsStoreSubscription.
65 66 67 68 69 70 |
# File 'lib/kubemq/pubsub/events_store_subscription.rb', line 65 def initialize(channel:, start_position:, start_position_value: 0, group: nil) @channel = channel @start_position = start_position @start_position_value = start_position_value @group = group end |
Instance Attribute Details
#channel ⇒ String
Returns channel name to subscribe to.
59 60 61 |
# File 'lib/kubemq/pubsub/events_store_subscription.rb', line 59 def channel @channel end |
#group ⇒ String?
Returns consumer group for load-balanced delivery.
59 |
# File 'lib/kubemq/pubsub/events_store_subscription.rb', line 59 attr_accessor :channel, :group, :start_position, :start_position_value |
#start_position ⇒ Integer
Returns one of the KubeMQ::PubSub::EventStoreStartPosition constants.
59 |
# File 'lib/kubemq/pubsub/events_store_subscription.rb', line 59 attr_accessor :channel, :group, :start_position, :start_position_value |
#start_position_value ⇒ Integer
Returns sequence number, Unix timestamp, or delta depending on start_position.
59 |
# File 'lib/kubemq/pubsub/events_store_subscription.rb', line 59 attr_accessor :channel, :group, :start_position, :start_position_value |
Instance Method Details
#subscribe_type ⇒ Integer
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns the subscribe type constant for the transport layer.
76 77 78 |
# File 'lib/kubemq/pubsub/events_store_subscription.rb', line 76 def subscribe_type SubscribeType::EVENTS_STORE end |