Archived
3
0
This commit is contained in:
Karchnu 2020-07-03 22:41:07 +02:00
parent 6b47af9e9f
commit 77026a249a
3 changed files with 13 additions and 6 deletions

View File

@ -1 +1,8 @@
require "./ipc/*" require "./ipc/lowlevel.cr"
require "./ipc/exception.cr"
require "./ipc/message.cr"
require "./ipc/event.cr"
require "./ipc/switch.cr"
require "./ipc/context.cr"
require "./ipc/client.cr"
require "./ipc/service.cr"

View File

@ -83,11 +83,11 @@ class IPC::Context
end end
def loop(&block : Proc(IPC::Event::Events|Exception, Nil)) def loop(&block : Proc(IPC::Event::Events|Exception, Nil))
if @base_timer > 0 && @timer == 0
@timer = @base_timer
end
::loop do ::loop do
if @base_timer > 0 && @timer == 0
@timer = @base_timer
end
yield wait_event &block yield wait_event &block
end end
end end

View File

@ -25,7 +25,7 @@ class IPC::JSON
end end
end end
class IPC::Connection class IPC::Context
def send(message : IPC::JSON) def send(message : IPC::JSON)
send message.type.to_u8, message.to_json send message.type.to_u8, message.to_json
end end