diff --git a/src/main.cr b/src/main.cr index a3d7077..a18aa3e 100644 --- a/src/main.cr +++ b/src/main.cr @@ -65,6 +65,19 @@ authd = AuthD::Client.new key = authd_key authd.key = key if key.is_a? String +# FIXME: Upstream this? +class IPC::Service + def loop(&block : Proc(IPC::Event::Connection | IPC::Event::Disconnection | IPC::Event::Message | IPC::Exception, Nil)) + previous_def do |event| + begin + block.call event + rescue e + STDERR.puts "IPC::Service caught an exception: #{e}" + end + end + end +end + IPC::Service.new "kanban" do |event| case event when IPC::Event::Connection