Class: KubeMQ::PubSub::EventsSubscription
- Inherits:
-
Object
- Object
- KubeMQ::PubSub::EventsSubscription
- Defined in:
- lib/kubemq/pubsub/events_subscription.rb
Overview
Configuration for subscribing to real-time (non-durable) events.
Pass to KubeMQ::PubSubClient#subscribe_to_events along with a block to
receive EventReceived messages. Supports wildcard channels
(+*+ and >) and consumer groups for load balancing.
Instance Attribute Summary collapse
-
#channel ⇒ String
Channel name or wildcard pattern to subscribe to.
-
#group ⇒ String?
Consumer group for load-balanced delivery.
Instance Method Summary collapse
-
#initialize(channel:, group: nil) ⇒ EventsSubscription
constructor
A new instance of EventsSubscription.
-
#subscribe_type ⇒ Integer
private
Returns the subscribe type constant for the transport layer.
Constructor Details
#initialize(channel:, group: nil) ⇒ EventsSubscription
Returns a new instance of EventsSubscription.
29 30 31 32 |
# File 'lib/kubemq/pubsub/events_subscription.rb', line 29 def initialize(channel:, group: nil) @channel = channel @group = group end |
Instance Attribute Details
#channel ⇒ String
Returns channel name or wildcard pattern to subscribe to.
25 26 27 |
# File 'lib/kubemq/pubsub/events_subscription.rb', line 25 def channel @channel end |
#group ⇒ String?
Returns consumer group for load-balanced delivery.
25 |
# File 'lib/kubemq/pubsub/events_subscription.rb', line 25 attr_accessor :channel, :group |
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.
38 39 40 |
# File 'lib/kubemq/pubsub/events_subscription.rb', line 38 def subscribe_type SubscribeType::EVENTS end |