Permalink
Browse files

Run finalizers inside a Task

  • Loading branch information...
1 parent 7fcf543 commit 252ef533a19f9fd626cd45078ad0e0e6a0b05419 @tarcieri tarcieri committed May 22, 2012
Showing with 2 additions and 1 deletion.
  1. +2 −1 lib/celluloid/actor.rb
View
@@ -262,7 +262,8 @@ def shutdown(exit_event = ExitEvent.new(@proxy))
# Run the user-defined finalizer, if one is set
def run_finalizer
- @subject.finalize if @subject.respond_to? :finalize
+ return unless @subject.respond_to? :finalize
+ Task.new(:finalizer) { @subject.finalize }.resume
rescue => ex
Logger.crash("#{@subject.class}#finalize crashed!", ex)
end

0 comments on commit 252ef53

Please sign in to comment.