Re: Asynchronous socket communication with agents

2014-05-15 Thread Dylan Gleason
Thanks for your response, Gary. Just out of curiosity, what is the advantage of using the java Thread as opposed to using the Clojure future? Will it yield the same effect or must I use Thread to explicitly join the threads when they are done executing? -- Dylan On Thursday, May 15, 2014 12:04

Re: Asynchronous socket communication with agents

2014-05-15 Thread Gary Verhaegen
While an agent is probably what you want, you should not use it like that. I'm not sure how you can get a failed state with the given code, but here's how I would do it. First off, the agent is only meant for logging, so let's keep it on that job alone. In log-entry, replace the (dosync ...) with:

Asynchronous socket communication with agents

2014-05-14 Thread Dylan Gleason
I have a TCP socket connection in which I need to process several requests and conj each request and it's corresponding response to a vector for logging purposes. I need to transmit and receive via two asynchronous threads, where a transmit function is responsible for sending requests and a r