Module: OmfRc::ResourceProxy::Frisbeed

Includes:
OmfRc::ResourceProxyDSL
Defined in:
lib/nitos_testbed_rc/frisbeed.rb

Overview

frisbee server created by parent :frisbee_factory used in load command

Instance Method Summary collapse

Instance Method Details

#process_event(res, event_type, app_id, msg) ⇒ Object

This method processes an event coming from the application instance, which was started by this Resource Proxy (RP). It is a callback, which is usually called by the ExecApp class in OMF

Parameters:

  • res (AbstractResource)

    this RP

  • event_type (String)

    the type of event from the app instance (STARTED, DONE.OK, DONE.ERROR, STDOUT, STDERR)

  • app_id (String)

    the id of the app instance

  • msg (String)

    the message carried by the event



83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
# File 'lib/nitos_testbed_rc/frisbeed.rb', line 83

def process_event(res, event_type, app_id, msg)
  logger.info "Frisbeed: App Event from '#{app_id}' - #{event_type}: '#{msg}'"
  if event_type == 'EXIT' #maybe i should inform you for every event_type.
    res.inform(:status, {
      status_type: 'FRISBEED',
      event: event_type.to_s.upcase,
      app: app_id,
      exit_code: msg,
      msg: msg
    }, :ALL)
  elsif event_type == 'STDOUT'
    res.inform(:status, {
      status_type: 'FRISBEED',
      event: event_type.to_s.upcase,
      app: app_id,
      exit_code: msg,
      msg: msg
    }, :ALL)
  end
end