rsmp 0.8.5 → 0.8.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e12fd3ea8f7f931b3ce3269a13e8ccd1248642a89062682b0088d044732f1757
4
- data.tar.gz: ff18134bf0e16210e30a5820f5bd2c27b5fb7f81bcf2f9f993e6c8aefe69d9d5
3
+ metadata.gz: 437183789b08f12b23264bc2716b84fd6c2298c2abab58dfb0b64529d004ac7d
4
+ data.tar.gz: 5595afbb4edb5d3e66320cae10c92c98a13fd56848095bb8ec4bb3615a097b05
5
5
  SHA512:
6
- metadata.gz: 3335d30f728748483d26e5d3d0c5671746b80dece2badc781064d0ae81f277fd7b899e9e508255a17d6f1cbd017a64164f6f0a21f1ca777b359c23b1fa482ebf
7
- data.tar.gz: a2e457988983d9c3173f91c1269979ea6a37ce75ac5e0acc30f21fbb34d2cfab8fe81295ac43c6a6010df0f7c06e11dc9efadd01c28fc20a0e77ff6d6c580787
6
+ metadata.gz: f3cdc4723d2d4616cc703d18aca6432c354bdbd7e4084c443a5f17aa8c420463d567813e73dc3fb454f02461b773149970932ee1d6d84f0434d8eaf21324a0ff
7
+ data.tar.gz: b90f7f2c8edc5722e0044cb31107779caabc4a9acbfce8bb713dd9a7d84e7272dd96fb2aad293c7d30e2350701758fe5300cfed776a774a754798cf8ac91037c
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- rsmp (0.8.5)
4
+ rsmp (0.8.6)
5
5
  async (~> 1.29.1)
6
6
  async-io (~> 1.32.2)
7
7
  colorize (~> 0.8.1)
@@ -2,7 +2,7 @@ module RSMP
2
2
  # Class for waiting for an aggregated status response
3
3
  class AggregatedStatusCollector < Collector
4
4
  def initialize proxy, options={}
5
- required = { type: ['AggregatedStatus','MessageNotAck'], title: 'aggregated status' }
5
+ required = { type: 'AggregatedStatus', title: 'aggregated status' }
6
6
  super proxy, options.merge(required)
7
7
  end
8
8
  end
@@ -3,7 +3,7 @@ module RSMP
3
3
  class CommandResponseCollector < StateCollector
4
4
  def initialize proxy, want, options={}
5
5
  super proxy, want, options.merge(
6
- type: ['CommandResponse','MessageNotAck'],
6
+ type: 'CommandResponse',
7
7
  title:'command response'
8
8
  )
9
9
  end
@@ -2,8 +2,9 @@ module RSMP
2
2
  # Base class for waiting for status updates or responses
3
3
  class StatusCollector < StateCollector
4
4
  def initialize proxy, want, options={}
5
- super proxy, want, options.merge(title: 'status response', type:['MessageNotAck'])
5
+ super proxy, want, options.merge(title: 'status response')
6
6
 
7
+ @options[:type] ||= []
7
8
  @options[:type] << 'StatusUpdate' unless options[:updates] == false
8
9
  @options[:type] << 'StatusResponse' unless options[:reponses] == false
9
10
  end
data/lib/rsmp/proxy.rb CHANGED
@@ -572,20 +572,6 @@ module RSMP
572
572
  node.site_id
573
573
  end
574
574
 
575
- def wait_for_acknowledgement parent_task, options={}, m_id
576
- collector = Collector.new self, options.merge(task: parent_task, type: ['MessageAck','MessageNotAck'])
577
- collector.collect do |message|
578
- if message.is_a?(MessageNotAck)
579
- if message.attribute('oMId') == m_id
580
- m_id_short = RSMP::Message.shorten_m_id m_id, 8
581
- raise RSMP::MessageRejected.new "Aggregated status request #{m_id_short} was rejected with '#{message.attribute('rea')}'"
582
- end
583
- elsif message.is_a?(MessageAck)
584
- collector.complete if message.attribute('oMId') == m_id
585
- end
586
- end
587
- end
588
-
589
575
  def send_and_optionally_collect message, options, &block
590
576
  collect_options = options[:collect] || options[:collect!]
591
577
  if collect_options
@@ -138,8 +138,8 @@ module RSMP
138
138
  "mId" => m_id,
139
139
  })
140
140
 
141
- send_and_optionally_collect message, options do |task|
142
- wait_for_acknowledgement task, options[:collect], m_id
141
+ send_and_optionally_collect message, options do |collect_options|
142
+ Collector.new self, collect_options.merge(task:@task, type: 'MessageAck')
143
143
  end
144
144
  end
145
145
 
data/lib/rsmp/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module RSMP
2
- VERSION = "0.8.5"
2
+ VERSION = "0.8.6"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rsmp
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.5
4
+ version: 0.8.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Emil Tin