Thanks for suggestion. I will check out Lazy.jl. Very nice feature to have built into a language. Regarding HTTPClient.jl, appears the current package doesn't support this feature. I was told to make a feature request, which I will do. Thanks for timely response.
On Sunday, January 4, 2015 6:13:16 AM UTC-6, Mike Innes wrote: > > I'm not that familiar with HTTPClient.jl specifically, but usually if you > have a stream of data you can do > > JSON.parse(io) > > in a loop, and it will only block until the next JSON object is finished. > > Julia doesn't do much that's Clojure-like by default but you may be > interested in Lazy.jl <https://github.com/one-more-minute/Lazy.jl>, which > provides Clojurey features like lazy sequences and dynamic binding. I don't > think it will solve your immediate problem, though. > > On 4 January 2015 at 06:15, C. Bryan Daniels <[email protected] > <javascript:>> wrote: > >> In Julia, if a function returns a continuous stream of data, is it >> possible to 'take' the head of the stream before the stream has terminated? >> I am used to Clojure which has many mechanisms to do exactly this? I assume >> this is due to the inherent laziness of Clojure. >> >> I made a previous post regarding a situation in which I was attempting to >> use 'HTTPClient' for a GET to a service that returns a continuous reply of >> json objects. I thought the following might work, but the fetch(r ) still >> blocks: >> >> rr = get(url, RequestOptions(blocking=false, ...)) >> r = fetch(r )) >> readytes(r) >> >> Thanks. >> > >
