For simply passing value, use [channels](https://nim-lang.org/docs/channels.html) .
Looking at your case, I guess you should use channels. You have two separate thread, first is qml thread and 2nd server thread. Using channel, you can apply producer-consumer pattern to both.