Arc Forumnew | comments | leaders | submitlogin
2 points by rocketnia 5401 days ago | link | parent

I'm not very familiar with srv.arc and stuff yet, but it seems to me like your (runjob) thread is just outliving the lifetime of the socket-accept streams opened in srv.arc's handle-request-1. First of all, your defopl form registers its behavior in the srvops* table. Later, in handle-request-1, a socket is opened, and then handle-request-thread is called, which in turn calls the srvops* op, but in the context of a w/stdout to that socket. Your thread is created, your op returns, and handle-request-1 closes the socket streams. Then your thread continues to run, and I presume that it tries to display something, but that the output is directed to the output stream that was already closed.

I don't know your specific situation, but if this is a page the admin visits in order to trigger (runjob) on the server, then the output of runjob--if there is any--is probably for the benefit of the server logs rather than something intended to be shown on the "/doit" page itself, right? If so, then I bet you can just change (thread (runjob)) to (thread (w/stdout console-out* (runjob))) and add (= console-out* (stdout)) somewhere on the top level.