Is neko web do not support Thread?


(Mr Zhan) #1

is neko web do not support Thread?

nekotools server -p 2000 -h -d ./

I try to compile neko and set for my http server ,and run this code


function threadListen() {
		while (true) {
			try {
				var text = socket.input.readLine();
				console.write(text + '\n');
			} catch (z:Dynamic) {
				console.write('Connection lost.\n');

is neko web not support thread?

(Luke) #2

When you create a thread, it is created separate from the main thread, so any calls you make on the second thread will operate on the second thread, but all your results are being fed through the main thread so the function call is redundant at that point. You need to send and read messages between the main and secondary threads in order to get the results you want.

Check out the following archived tutorial.

(Mr Zhan) #3

thank you ,