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.



1271
1272
1273
1274
1275
1276
1277
1278
1279
# File 'lib/wamp_client/message.rb', line 1271

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.



1269
1270
1271
# File 'lib/wamp_client/message.rb', line 1269

def invocation_request
  @invocation_request
end

#optionsObject

Returns the value of attribute options.



1269
1270
1271
# File 'lib/wamp_client/message.rb', line 1269

def options
  @options
end

Class Method Details

.parse(params) ⇒ Object



1285
1286
1287
1288
1289
1290
1291
1292
1293
# File 'lib/wamp_client/message.rb', line 1285

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



1281
1282
1283
# File 'lib/wamp_client/message.rb', line 1281

def self.type
  Types::INTERRUPT
end

Instance Method Details

#payloadObject



1295
1296
1297
1298
1299
1300
1301
# File 'lib/wamp_client/message.rb', line 1295

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

  payload
end

#to_sObject



1303
1304
1305
# File 'lib/wamp_client/message.rb', line 1303

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