Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

allow requiring celluloid without autostart

  • Loading branch information...
commit 0f84cf779d83ddc4651a24a9ce900aa177e01add 1 parent a2e1bc3
@schmurfy authored
Showing with 20 additions and 7 deletions.
  1. +20 −7 lib/celluloid/boot.rb
View
27 lib/celluloid/boot.rb
@@ -1,10 +1,23 @@
# Things to run after Celluloid is fully loaded
+module Celluloid
+ module_function
+
+ def start
+ unless @started
+ # Configure default systemwide settings
+ Celluloid.task_class = Celluloid::TaskFiber
+ Celluloid.logger = ::Logger.new(STDERR)
+
+ # Launch default services
+ # FIXME: We should set up the supervision hierarchy here
+ Celluloid::Notifications::Fanout.supervise_as :notifications_fanout
+ Celluloid::IncidentReporter.supervise_as :default_incident_reporter, STDERR
+ @started = true
+ end
+ end
+end
-# Configure default systemwide settings
-Celluloid.task_class = Celluloid::TaskFiber
-Celluloid.logger = Logger.new(STDERR)
-# Launch default services
-# FIXME: We should set up the supervision hierarchy here
-Celluloid::Notifications::Fanout.supervise_as :notifications_fanout
-Celluloid::IncidentReporter.supervise_as :default_incident_reporter, STDERR
+unless defined?(CELLULOID_DISABLE_AUTOSTART)
+ Celluloid.start()
+end
Please sign in to comment.
Something went wrong with that request. Please try again.