Constructor.
Close the connection to the main thread.
Run the specified delegate in the origin thread, without waiting for it to finish.
Run the specified delegate in the origin thread, and wait for it to finish.
Start establishing a connection.
void onConnect(TcpConnection socket) { auto mainThread = thisThread; new Thread({ string s = readln(); mainThread.runAsync({ socket.send(s); socket.disconnect(); }); }).start(); }
An object which allows calling a function in a different thread. Create ThreadAnchor in the main thread (the thread in which the code will run in), and then call runWait or runAsync from a different thread.
The main thread must be running an unblocked ae.net.asockets event loop.