Class: Bridgetown::Container
- Inherits:
-
Async::Container::Forked
- Object
- Async::Container::Forked
- Bridgetown::Container
- Defined in:
- bridgetown-core/lib/bridgetown-core/container.rb
Defined Under Namespace
Classes: Interceptor, Policy
Instance Method Summary collapse
-
#add_routine(routine) ⇒ Object
-
#initialize(**options) ⇒ Container
constructor
A new instance of Container.
-
#run ⇒ Object
Constructor Details
Instance Method Details
#add_routine(routine) ⇒ Object
14 15 16 |
# File 'bridgetown-core/lib/bridgetown-core/container.rb', line 14 def add_routine(routine) @routines[routine.key] = routine end |
#run ⇒ Object
18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 |
# File 'bridgetown-core/lib/bridgetown-core/container.rb', line 18 def run Process.setproctitle( "Bridgetown #{Bridgetown::VERSION} " \ "— Parent Container [#{File.basename(Dir.pwd)}]" ) @routines.each do |key, routine| interceptor = nil interceptor = Interceptor.with_tag(routine.tag[:value], color: routine.tag[:color]) \ if routine.respond_to?(:tag) spawn(name: routine.name, key: key) do |instance| interceptor&.hook routine.execute(instance) end end end |