Archived
3
0

Sending IPC::JSON, simplification for IPC::Client.

This commit is contained in:
Karchnu 2020-07-23 19:24:30 +02:00
parent 7870346afb
commit bc77e8c056

View File

@ -29,6 +29,18 @@ class IPC::Context
def send(fd : Int32, message : IPC::JSON) def send(fd : Int32, message : IPC::JSON)
send fd, message.type.to_u8, message.to_json send fd, message.type.to_u8, message.to_json
end end
def send_now(fd : Int32, message : IPC::JSON)
send_now fd, message.type.to_u8, message.to_json
end
end
class IPC::Client
def send(message : IPC::JSON)
send @server_fd.not_nil!, message.type.to_u8, message.to_json
end
def send_now(message : IPC::JSON)
send_now @server_fd.not_nil!, message.type.to_u8, message.to_json
end
end end
# CAUTION: Only use this method on an Array(IPC::JSON.class) # CAUTION: Only use this method on an Array(IPC::JSON.class)