Class: WampClient::Message::Interrupt

Inherits:
Base
  • Object
show all
Defined in:
lib/wamp_client/message.rb

Overview

Interrupt The “INTERRUPT” message is used with the Call Canceling advanced feature. Upon receiving a cancel for a pending call, a Dealer will issue an interrupt to the Callee. Formats:

[INTERRUPT, INVOCATION.Request|id, Options|dict]

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Check

included

Constructor Details

#initialize(invocation_request, options) ⇒ Interrupt

Returns a new instance of Interrupt.



1308
1309
1310
1311
1312
1313
1314
1315
1316
# File 'lib/wamp_client/message.rb', line 1308

def initialize(invocation_request, options)

  self.class.check_id('invocation_request', invocation_request)
  self.class.check_dict('options', options)

  self.invocation_request = invocation_request
  self.options = options

end

Instance Attribute Details

#invocation_requestObject

Returns the value of attribute invocation_request.



1306
1307
1308
# File 'lib/wamp_client/message.rb', line 1306

def invocation_request
  @invocation_request
end

#optionsObject

Returns the value of attribute options.



1306
1307
1308
# File 'lib/wamp_client/message.rb', line 1306

def options
  @options
end

Class Method Details

.parse(params) ⇒ Object



1322
1323
1324
1325
1326
1327
1328
1329
1330
# File 'lib/wamp_client/message.rb', line 1322

def self.parse(params)

  self.check_gte('params list', 3, params.count)
  self.check_equal('message type', self.type, params[0])

  params.shift
  self.new(*params)

end

.typeObject



1318
1319
1320
# File 'lib/wamp_client/message.rb', line 1318

def self.type
  Types::INTERRUPT
end

Instance Method Details

#payloadObject



1332
1333
1334
1335
1336
1337
1338
1339
# File 'lib/wamp_client/message.rb', line 1332

def payload

  payload = [self.class.type]
  payload.push(self.invocation_request)
  payload.push(self.options)

  payload
end

#to_sObject



1341
1342
1343
# File 'lib/wamp_client/message.rb', line 1341

def to_s
  'INTERRUPT > ' + self.payload.to_s
end