# So yeah, this is the smallest example I can make: import std/[threadpool, os] var commChan: Channel[string] proc setupSender() = proc sendMsg() = echo "Type in a message for the Backend!" while true: let terminalInput = readLine(stdin) echo "Sending message from Frontend from thread ", getThreadId(), ": ", terminalInput commChan.send(terminalInput) spawn sendMsg() proc setupReceiver() = proc recvMsg() = while true: let msg: string = commChan.recv() echo "Received message at Backend on Thread: ", getThreadId(), " :", msg spawn recvMsg() proc main() = commChan.open() setupSender() setupReceiver() sync() main()