Here is suggestion to use KEKS codec with a simple client-server
Remote Procedure Call interface. It is very similar to
=> JSON-RPC
=> MessagePack-RPC
Call, reply and notify message headers ([schema/tcl] format):
pkt {
{field . {choice}}
{field call {with call}}
{field notify {with notify}}
{field reply {with reply}}
}
call {
{field . {map}}
{field id {bin} >0}
{field fun {str} >0}
{field args {map}}
}
notify {
{field . {map}}
{field id {bin} >0 optional}
{field fun {str} >0}
{field args {map}}
}
reply {
{field . {map}}
{field id {bin} >0}
{field err {str} >0 optional}
{field body {map}}
}
It is advisable to use UUIDv7 for call/notify's id.
Reply's id must be the same as in corresponding call.
Empty error string means no error occurred.
Notification differs only by its type and no reply expectation.