diff --git a/core/ipc.cr b/core/ipc.cr index 4bedaf1..acd3410 100644 --- a/core/ipc.cr +++ b/core/ipc.cr @@ -74,6 +74,12 @@ class IPC::Service at_exit { close } end + def initialize(name : String, &block : Proc(IPC::Event::Connection | IPC::Event::Disconnection | IPC::Event::Message, Nil)) + initialize name + loop &block + close + end + def close return if @closed