- Added stub `sendMessage(TaggedMessage)` which will encode into the tristanable format, then wrap into bformat and send over the socket
- Added import for `TaggedMessage` from `tristanable.encoding` module
This commit is contained in:
Tristan B. Velloza Kildaire 2023-03-26 18:35:19 +02:00
parent ed68bf7cd6
commit a05bc3e2fd
1 changed files with 12 additions and 0 deletions

View File

@ -7,6 +7,7 @@ import std.socket;
import tristanable.queue : Queue;
import core.sync.mutex : Mutex;
import tristanable.manager.watcher : Watcher;
import tristanable.encoding : TaggedMessage;
/**
* Manages a provided socket by spawning
@ -68,6 +69,17 @@ public class Manager
// TODO: Unlock queue
}
public void sendMessage(TaggedMessage tag)
{
// TODO: Send the given message
// TODO: Encode into bytes; call it `x`
// TODO: Wrap `x` in bformat; call it `y`
// TODO: Do socket.send(`y`)
}
}