diff options
author | Jérémy Zurcher <jeremy@asynk.ch> | 2012-05-10 09:35:16 +0200 |
---|---|---|
committer | Jérémy Zurcher <jeremy@asynk.ch> | 2012-05-10 09:35:16 +0200 |
commit | 41f2adace41c562ea1ed486130c72eb4d1503044 (patch) | |
tree | fa6ec1ca039fca1cd729c59f2814adaacf598703 /lib/evendoors/door.rb | |
parent | 6886fa096d832b0682eafe631922694653384994 (diff) | |
download | edoors-ruby-41f2adace41c562ea1ed486130c72eb4d1503044.zip edoors-ruby-41f2adace41c562ea1ed486130c72eb4d1503044.tar.gz |
Door,Board: factorise release of @saved particle
Diffstat (limited to 'lib/evendoors/door.rb')
-rw-r--r-- | lib/evendoors/door.rb | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/lib/evendoors/door.rb b/lib/evendoors/door.rb index 0fe3867..7cff0b9 100644 --- a/lib/evendoors/door.rb +++ b/lib/evendoors/door.rb @@ -23,16 +23,18 @@ module EvenDoors EvenDoors::Spin.release_p p end # + def garbage + puts " * #{path} didn't give back #{p}" if EvenDoors::Spin.debug_errors + puts "\t#{@saved.data EvenDoors::ERROR_FIELD}" if @saved.action==EvenDoors::ACT_ERROR + release_p @saved + @saved = nil + end + # def process_p p @viewer.receive_p p if @viewer @saved = p receive_p p - if not @saved.nil? - puts "#{path} didn't give that particle back #{p}" if EvenDoors::Spin.debug_errors - puts "\t#{p.data EvenDoors::ERROR_FIELD}" if p.action==EvenDoors::ACT_ERROR - release_p @saved - @saved = nil - end + garbage if not @saved.nil? end # def process_sys_p p |