3 ms·
Thankyou, that has made it at least slightly more clear to me I think :) So what you need basically in the core of your server is some data structure (possibly
by jiggy2011 15y ago
Thankyou, that has made it at least slightly more clear to me I think :)
So what you need basically in the core of your server is some data structure (possibly keyed by the client's IP address and TCP port number?) that contains a bunch of functions with prepopulated arguments (curried functions?).
The prepopulated arguments are basically the state set by the previous request. When a new request comes in you somehow match it up with your data structure and execute?
I guess the continuation part is to force the I/O to happen at the right point, i.e make the next request depend on the execution of the first?
Of course Javascript is not really functional so that needn't be explicit.