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):
call {
{field . {list} len=4}
{field 0 {str} =c}
{field 1 {hexlet}} {# id}
{field 2 {str} >0} {# method}
{field 3 {map}} {# params}
}
reply {
{field . {list} len=4}
{field 0 {str} =r}
{field 1 {hexlet}} {# id}
{field 2 {str}} {# error}
{field 3 {map}} {# body}
}
notify {
{field . {list} len=4}
{field 0 {str} =n}
{field 1 {hexlet}} {# id}
{field 2 {str} >0} {# method}
{field 3 {map}} {# body}
}
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.