celluloid 0.15.0.pre → 0.15.0.pre2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 802e81b987e2d65c9d7055c2160805612db65b50
4
- data.tar.gz: 2a2c5eaf4c8afa92a8ee3c782ffb3e6556454061
3
+ metadata.gz: 1cb300092f64efcf674f30d6c086f4d007f57c24
4
+ data.tar.gz: c00b421edd82f1acd76e806673a6f9c4a697a613
5
5
  SHA512:
6
- metadata.gz: 3bee45fcc9e099fcd5b61d605fa06293d9454402f65601ff789aac7c679e9f0d206a7f696a53d37fa3febeda10163dd5c2e4da1bc8dece2101bf1a3f949ca60e
7
- data.tar.gz: c897040ce47e50088ee2c53ea8291733d2214cb127d3014558e366f8a1e58239ea232a9d7381671d99c64fcf6dca6e65b6f1d8b335a986a8779b97f875a163da
6
+ metadata.gz: b9b3e8d806a7cc0bcef413ebbab6c2687ec08a7bf00ecc5bc6505513972705ff8f82f2ea18f47d32afe41163e04252de0cfbbb42c95aae1601618d805c32d1be
7
+ data.tar.gz: 145c065574c7e372bc2da20c7141a5372b5c529db75ade1fcbeb44efcbd605287a5cf66d773cb4c731415731ba9060f452b98b4e64d8482045381448185046e9
data/lib/celluloid.rb CHANGED
@@ -8,7 +8,7 @@ if defined?(JRUBY_VERSION) && JRUBY_VERSION == "1.7.3"
8
8
  end
9
9
 
10
10
  module Celluloid
11
- VERSION = '0.15.0.pre'
11
+ VERSION = '0.15.0.pre2'
12
12
  Error = Class.new StandardError
13
13
 
14
14
  extend self # expose all instance methods as singleton methods
@@ -314,7 +314,7 @@ module Celluloid
314
314
  message.dispatch
315
315
  else
316
316
  unless @receivers.handle_message(message)
317
- Logger.debug "Discarded message (unhandled): #{message}"
317
+ Logger.debug "Discarded message (unhandled): #{message}" if $CELLULOID_DEBUG
318
318
  end
319
319
  end
320
320
  message
@@ -368,11 +368,15 @@ module Celluloid
368
368
  # Run the user-defined finalizer, if one is set
369
369
  def run_finalizer
370
370
  finalizer = @subject.class.finalizer
371
- if finalizer && @subject.respond_to?(finalizer, true)
372
- task(:finalizer, :method_name => finalizer, :dangerous_suspend => true) { @subject.__send__(finalizer) }
371
+ return unless finalizer && @subject.respond_to?(finalizer, true)
372
+
373
+ task(:finalizer, :method_name => finalizer, :dangerous_suspend => true) do
374
+ begin
375
+ @subject.__send__(finalizer)
376
+ rescue => ex
377
+ Logger.crash("#{@subject.class}#finalize crashed!", ex)
378
+ end
373
379
  end
374
- rescue => ex
375
- Logger.crash("#{@subject.class}#finalize crashed!", ex)
376
380
  end
377
381
 
378
382
  # Clean up after this actor
@@ -142,7 +142,7 @@ module Celluloid
142
142
  private
143
143
 
144
144
  def dead_letter(message)
145
- Logger.debug "Discarded message (mailbox is dead): #{message}"
145
+ Logger.debug "Discarded message (mailbox is dead): #{message}" if $CELLULOID_DEBUG
146
146
  end
147
147
 
148
148
  def mailbox_full
@@ -148,6 +148,7 @@ module Celluloid
148
148
  end
149
149
 
150
150
  def terminate
151
+ @registry.delete(@name) if @name
151
152
  @actor.terminate if @actor
152
153
  rescue DeadActorError
153
154
  end
@@ -28,6 +28,12 @@ describe Celluloid::SupervisionGroup do
28
28
  my_registry[:example].should be_running
29
29
  end
30
30
 
31
+ it "removes actors from the registry when terminating" do
32
+ group = MyGroup.run!
33
+ group.terminate
34
+ Celluloid::Actor[:example].should be_nil
35
+ end
36
+
31
37
  context "pool" do
32
38
  before :all do
33
39
  class MyActor
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: celluloid
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.15.0.pre
4
+ version: 0.15.0.pre2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tony Arcieri
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-08-22 00:00:00.000000000 Z
11
+ date: 2013-08-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: timers