mentorenwahl/docker/backend/src/backend/run.cr
Dominic Grimm 5bc10f8aaf
Some checks failed
continuous-integration/drone/push Build is failing
Added worker
2022-01-23 09:12:57 +01:00

29 lines
404 B
Crystal

module Backend
extend self
def run : Nil
puts "Running backend..."
puts "-" * 10
channel = Channel(Nil).new
spawn same_thread: true do
puts "Starting API..."
API.run
channel.send(nil)
end
spawn same_thread: true do
puts "Starting worker..."
Worker.run
channel.send(nil)
end
2.times do
channel.receive
end
end
end