Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Multithreaded Clojure Luminus server?

I am not sure how to phrase this, but any ideas about how to achieve the below behavior would be great.

I have web server that makes long running calls to a command line program. I want the server to handle multiple long running calls, but not return a given request until the call is complete. This is not a website, so it is okay that the calls run a very long time, and the client will not timeout either. Any ideas about how to achieve this?

Is this link relevant? writing a multiplexing server in clojure?

like image 236
user1559027 Avatar asked Dec 26 '22 07:12

user1559027


1 Answers

Given that Luminus generates a war file (which I assume it does, because it runs on top of ring and compojure) then it is already "multi-threaded" in that when you run that war file in tomcat or jetty, each request will get its own thread.

Clients can set their socket read timeout to infinite and they'll wait forever.

like image 84
Kevin Avatar answered Jan 09 '23 18:01

Kevin