Re: Clojurescript long polling questions

2012-05-04 Thread Dusan Miloradovic
Thanks for great answers Daniel and Zach Dusan On Fri, May 4, 2012 at 3:28 PM, Zach Tellman wrote: > That documentation is for the Lamina library, and describes how > full-duplex client connections are represented. If you created a TCP > client, all that would be true. > > However, you are wri

Re: Clojurescript long polling questions

2012-05-04 Thread Zach Tellman
That documentation is for the Lamina library, and describes how full-duplex client connections are represented. If you created a TCP client, all that would be true. However, you are writing a server, and using HTTP, which is a much more structured protocol. Each request takes only a single re

Re: Clojurescript long polling questions

2012-05-03 Thread Daniel Renfer
>From the Lamina result-channel documentation[1]: A result-channel represents a single potential value, as opposed to a normal channel which represents a stream of values. The way it works is that the result channel waits for only a single value and then closes. If the connection is closed (you c

Re: Clojurescript long polling questions

2012-05-02 Thread Dusan Miloradovic
Hmm, acording to the aleph documentation: A connection to a server is represented by a result-channel. If the connection is successful, the result-channel will emit a channel that can be used to communicate with the server. *When the connec

Re: Clojurescript long polling questions

2012-05-02 Thread Daniel Renfer
I think your issue is, you say you want long polling, but it seems like what you're looking for is more of HTTP streaming. The result channel you get in the aleph handler is set up to receive only a single message and then close. If you want a streaming response, create a new channel and a request

Re: Clojurescript long polling questions

2012-05-01 Thread Dusan Miloradovic
Unfortunaltely that does not work either, thank you for the help. It stops receiving after the first message, just like before. Here is the updated version: (defn long-poll-newest ([url callback error-callback] (long-poll-newest url callback error-callback (net/xhr-connection))) ([url cal

Re: Clojurescript long polling questions

2012-05-01 Thread Gijs S.
The order of arguments you pass to long-poll-newest doesn't look right. You defined long-poll-newest to optionally take a fourth parameter for the existing xhr connection. However, when calling long-poll-newest you pass the existing xhr connection as the first argument. Replace (long-poll-newest