1. http.e feature
- Posted by useless_ Mar 07, 2014
- 1248 views
- Last edited Mar 08, 2014
In http.e, there exists this code:
object has_data = sock:select(sock, {}, {}, timeout) if (length(has_data[1]) > 2) and equal(has_data[1][2],1) then object data = sock:receive(sock, 0)
It has always bothered me that sock:select is using the timeout, and that http.e isn't task-aware bothers me. These two deficencies mess up the speed and responsiveness of Euphoria. The tiny app news.ex runs much better if those lines are changed as follows:
object has_data = sock:select(sock, {}, {}, 0,0) if (length(has_data[1]) > 2) and not equal(has_data[1][2],1) -- if not readable then task_yield() -- pgm flow then falls to the bottom of while time()... else object data = sock:receive(sock,0)
useless