Class: Wamp::Client::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.



1281
1282
1283
1284
1285
1286
1287
1288
1289
# File 'lib/wamp/client/message.rb', line 1281

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.



1279
1280
1281
# File 'lib/wamp/client/message.rb', line 1279

def invocation_request
  @invocation_request
end

#optionsObject

Returns the value of attribute options.



1279
1280
1281
# File 'lib/wamp/client/message.rb', line 1279

def options
  @options
end

Class Method Details

.parse(params) ⇒ Object



1295
1296
1297
1298
1299
1300
1301
1302
1303
# File 'lib/wamp/client/message.rb', line 1295

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



1291
1292
1293
# File 'lib/wamp/client/message.rb', line 1291

def self.type
  Types::INTERRUPT
end

Instance Method Details

#payloadObject



1305
1306
1307
1308
1309
1310
1311
1312
# File 'lib/wamp/client/message.rb', line 1305

def payload

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

  payload
end

#to_sObject



1314
1315
1316
# File 'lib/wamp/client/message.rb', line 1314

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