Class: RServiceBus2::SubscriptionStorage

Inherits:
Object
  • Object
show all
Defined in:
lib/rservicebus2/subscription_storage.rb

Overview

Base class for subscription storage

Direct Known Subclasses

SubscriptionStorageFile

Instance Method Summary collapse

Constructor Details

#initialize(app_name, uri) ⇒ SubscriptionStorage

Constructor

Parameters:

  • app_name (String)

    Name of the application, which is used as a Namespace

  • uri (String)

    a location for the resource to which we will attach, eg redis://127.0.0.1/foo



11
12
13
14
# File 'lib/rservicebus2/subscription_storage.rb', line 11

def initialize(app_name, uri)
  @app_name = app_name
  @uri = uri
end

Instance Method Details

#add(_event_name, _queue_name) ⇒ Object

Add a new subscription

Parameters:

  • event_name (String)

    Name of the event for which the subscriber has asked for notification

  • queue_name (String)

    the queue to which the event should be sent



25
26
27
# File 'lib/rservicebus2/subscription_storage.rb', line 25

def add(_event_name, _queue_name)
  fail 'Method, add, needs to be implemented for this subscription storage'
end

#get_allObject

Get a list of all subscription, as an Array



17
18
19
# File 'lib/rservicebus2/subscription_storage.rb', line 17

def get_all
  fail 'Method, get_all, needs to be implemented for SubscriptionStorage'
end

#remove(_event_name, _queue_name) ⇒ Object

Remove an existing subscription

Parameters:

  • event_name (String)

    Name of the event for which the subscriber has asked for notification

  • queue_name (String)

    the queue to which the event should be sent



34
35
36
37
# File 'lib/rservicebus2/subscription_storage.rb', line 34

def remove(_event_name, _queue_name)
  fail 'Method, remove, needs to be implemented for this subscription
    storage'
end