timer
This commit is contained in:
parent
6b47af9e9f
commit
77026a249a
@ -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"
|
||||||
|
@ -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))
|
||||||
|
::loop do
|
||||||
if @base_timer > 0 && @timer == 0
|
if @base_timer > 0 && @timer == 0
|
||||||
@timer = @base_timer
|
@timer = @base_timer
|
||||||
end
|
end
|
||||||
|
|
||||||
::loop do
|
|
||||||
yield wait_event &block
|
yield wait_event &block
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -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
|
||||||
|
Reference in New Issue
Block a user