Class: Pione::Front::NotificationListenerFront

Inherits:
BasicFront
  • Object
show all
Defined in:
lib/pione/front/notification-listener-front.rb

Overview

NotificationListenerFront is a front interface for pione-notification-listener command.

Instance Attribute Summary

Attributes inherited from BasicFront

#uri

Instance Method Summary collapse

Methods inherited from BasicFront

#[], #[]=, #child_front_uri, #child_pids, #pid, #register_child, #system_logger, #terminate, #terminate_command, #unregister_child

Constructor Details

#initialize(cmd) ⇒ NotificationListenerFront

Returns a new instance of NotificationListenerFront.



6
7
8
# File 'lib/pione/front/notification-listener-front.rb', line 6

def initialize(cmd)
  super(cmd, Global.notification_listener_front_port)
end

Instance Method Details

#add(uri) ⇒ void

This method returns an undefined value.

Add the recipient that receives notification messages.

Parameters:

  • uri (String)

    URI of the recipent's front

  • recipient (Notification::Recipient)

    the recipient that receives notification messages



17
18
19
20
21
22
# File 'lib/pione/front/notification-listener-front.rb', line 17

def add(uri)
  non_blocking do
    @cmd.model.add_recipient(uri)
    Log::SystemLog.debug 'Recipient "%s" has been added.' % uri
  end
end

#delete(uri) ⇒ Object

Delete the recipient that receives notification messages.

Parameters:

  • uri (String)

    URI of the recipent's front



28
29
30
31
32
33
# File 'lib/pione/front/notification-listener-front.rb', line 28

def delete(uri)
  non_blocking do
    @cmd.model.delete_recipient(uri)
    Log::SystemLog.debug 'Recipient "%s" has been deleted.' % uri
  end
end