Hello, all.
I was able to build a non-blocking web-server using network sockets.
However, the existing guile web/server.scm implementation is
single-threaded and therefore blocking, which is sub-optimal for some
use-cases.

I suggest we slightly modify the server logic to have an optional
#:blocking? [bool] parameter which would enable behavior in line with the
following excerpt from my own code. Obviously some changes would be made to
methodology and code style, but you get the picture.

(define (listen sock)
  (let* (
    (client-connection (accept sock))
    (client-details (cdr client-connection))
    (client (car client-connection)))
    (begin-thread
      (sigaction SIGPIPE SIG_IGN)
      (handle client)
      (close client))
    ))

This shouldn't cause any backwards-compatibility issues since it's
optional, but the specifics of web/server.scm might cause problems.
Let me know what you think!
Ryan

Reply via email to