Class: RServiceBus::SubscriptionStorage

Inherits:
Object
  • Object
show all
Defined in:
lib/rservicebus/SubscriptionStorage.rb

Overview

Base class for subscription storage

Instance Method Summary collapse

Constructor Details

#initialize(appName, uri) ⇒ SubscriptionStorage

Constructor

Parameters:

  • appName (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



15
16
17
18
# File 'lib/rservicebus/SubscriptionStorage.rb', line 15

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

Instance Method Details

#add(eventName, queueName) ⇒ Object

Add a new subscription

Parameters:

  • eventName (String)

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

  • queueName (String)

    the queue to which the event should be sent



32
33
34
# File 'lib/rservicebus/SubscriptionStorage.rb', line 32

def add( eventName, queueName )
	raise 'Method, add, needs to be implemented for this subscription storage'
end

#getAllObject

Get a list of all subscription, as an Array

Parameters:

  • appName (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



24
25
26
# File 'lib/rservicebus/SubscriptionStorage.rb', line 24

def getAll
	raise 'Method, getResource, needs to be implemented for resource'
end

#remove(eventName, queueName) ⇒ Object

Remove an existing subscription

Parameters:

  • eventName (String)

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

  • queueName (String)

    the queue to which the event should be sent



40
41
42
# File 'lib/rservicebus/SubscriptionStorage.rb', line 40

def remove( eventName, queueName )
	raise 'Method, remove, needs to be implemented for this subscription storage'
end