This commit is contained in:
Raycho Mukelov 2023-09-12 12:50:40 +03:00
parent 1f683dd2a7
commit 491b9129f6
2 changed files with 6 additions and 2 deletions

View File

@ -37,18 +37,20 @@ proc TestRaftMessageSendCallbackCreate(): RaftMessageSendCallback =
host = c.host
port = c.port
var
client = newAsyncHttpClient()
client = newHttpClient()
s = MsgStream.init() # besides MsgStream, you can also use Nim StringStream or FileStream
s.pack(msg) #here the magic happened
var
resp = await client.post(fmt"http://host:port", s.data)
resp = client.post(fmt"http://{host}:{port}", s.data)
echo resp.status
var
ss = MsgStream.init(resp.body)
xx: RaftMessageResponseBase
ss.unpack(xx) #and here too
result = xx

View File

@ -48,6 +48,8 @@ async def main():
if __name__ == "__main__":
try:
readFIFO = readFIFO + sys.argv[1]
writeFIFO = writeFIFO + sys.argv[1]
os.mkfifo(readFIFO)
os.mkfifo(writeFIFO)
except OSError as oe: