Dominic Grimm
0e742965cc
All checks were successful
continuous-integration/drone/push Build is passing
23 lines
382 B
Crystal
23 lines
382 B
Crystal
module Backend
|
|
extend self
|
|
|
|
def run : Nil
|
|
Log.info { "Starting backend services..." }
|
|
|
|
channel = Channel(Nil).new(SERVICES.size)
|
|
|
|
SERVICES.each do |service|
|
|
spawn do
|
|
service.call
|
|
channel.send(nil)
|
|
end
|
|
end
|
|
|
|
SERVICES.size.times do
|
|
channel.receive
|
|
end
|
|
Fiber.yield
|
|
Log.info { "Backend services started." }
|
|
end
|
|
end
|