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.



1230
1231
1232
1233
1234
1235
1236
1237
1238
# File 'lib/wamp/client/message.rb', line 1230

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.



1228
1229
1230
# File 'lib/wamp/client/message.rb', line 1228

def invocation_request
  @invocation_request
end

#optionsObject

Returns the value of attribute options.



1228
1229
1230
# File 'lib/wamp/client/message.rb', line 1228

def options
  @options
end

Class Method Details

.parse(params) ⇒ Object



1244
1245
1246
1247
1248
1249
1250
1251
1252
# File 'lib/wamp/client/message.rb', line 1244

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



1240
1241
1242
# File 'lib/wamp/client/message.rb', line 1240

def self.type
  Types::INTERRUPT
end

Instance Method Details

#payloadObject



1254
1255
1256
1257
1258
1259
1260
1261
# File 'lib/wamp/client/message.rb', line 1254

def payload

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

  payload
end

#to_sObject



1263
1264
1265
# File 'lib/wamp/client/message.rb', line 1263

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