Re: core.async take behaviour

2014-09-03 Thread cig
Thanks Timothy, that makes sense. A follow on question if you don't mind. I would like to 'take' n items off of a channel, but wait until n items are available rather than eagerly returning the way take does. Do you have any ideas on how I could achieve this? On Tuesday, 2 September 2014

Re: core.async take behaviour

2014-09-03 Thread Gary Verhaegen
I'd use another channel on which I put vectors of the correct length, with an intermediate loop that takes from the first channel, accumulates until the vector has the right size, and then put the vector on the second channel. There might be a better solution with transducers, though. (Or

Re: HTTP server that supports ring handlers, but asynchronously?

2014-09-03 Thread Laurens Van Houtven
Hi James, Thanks for your response! Replies inline. On 02 Sep 2014, at 18:53, James Reeves ja...@booleanknot.com wrote: Ring uses blocking I/O by default, because that's often sufficient for most web servers, and is generally easier to reason about. HTTP works best when the response is

Re: tomcat 6/7 stream closed error in ring json - works in lein ring server

2014-09-03 Thread Colin Yates
(is this is the longest delay in replying ever? :)) You are right - I mistakenly thought that json-wrap-params only exposed the request params as oppose to exposing the JSONified body in the params; I thought json-wrap-body and json-wrap-params were complimentary. Now I have read the docs

Re: [ANN] shadow-pgsql: PostgreSQL without JDBC

2014-09-03 Thread Ludwik Grodzki
Hi. Have you tried it with Amazon's redshift? Regards. Ludwik. On Thursday, 21 August 2014 19:00:11 UTC+1, Thomas Heller wrote: Hey Clojure Folk, I'm close to releasing the first alpha version of https://github.com/thheller/shadow-pgsql a native interface to PostgreSQL I wrote. Its

Re: [ANN] shadow-pgsql: PostgreSQL without JDBC

2014-09-03 Thread Thomas Heller
Hey, No. I was not aware that redshift is PostgreSQL under the hood. Based on the docs it is based on PostgreSQL 8.0.2 and might not support some features I use to get the type thing working. It might be possible to make it work but you'll probably lose most of the features I implemented

Re: core.async take behaviour

2014-09-03 Thread Yohan Pereira
On Wed, Sep 3, 2014 at 11:31 AM, cig clifford.goldb...@gmail.com wrote: Thanks Timothy, that makes sense. A follow on question if you don't mind. I would like to 'take' n items off of a channel, but wait until n items are available rather than eagerly returning the way take does. Do you have

Re: HTTP server that supports ring handlers, but asynchronously?

2014-09-03 Thread Linus Ericsson
Pedestal pedestal-service handles requests asynchronously by extending the ring standard with Interceptors, sort of a state machine queue version the wrapped handlers of ring. /Linus Den 3 sep 2014 10:35 skrev Laurens Van Houtven _...@lvh.io: Hi James, Thanks for your response! Replies

Re: HTTP server that supports ring handlers, but asynchronously?

2014-09-03 Thread Herwig Hochleitner
Yet another: I'm using a servlet implementation, that can be deployed in any servlet container supporting servlet api 3.0 (with async) https://github.com/webnf/webnf/tree/master/async-servlet It allows to return a function instead of a regular ring response, that will get an async context to

Re: HTTP server that supports ring handlers, but asynchronously?

2014-09-03 Thread James Reeves
On 3 September 2014 09:35, Laurens Van Houtven _...@lvh.io wrote: (defn handler [req] (httpkit/with-channel req http-ch (let [resp-ch (async-handler! req)] (httpkit/on-close (fn [_] (a/close! resp-ch))) (a/take! resp-ch (fn [resp] (httpkit/send!

ClassCastExecption with conj on deftype

2014-09-03 Thread Karsten Schmidt
Hi all, I've defined a custom vector type and implemented various clj/cljs protocols, but now ended up hitting my head against some weird behaviour with conj (or rather cons, internally). The type defines a 2-element vector-like construct and my cons implementation would simply return a standard

Re: ClassCastExecption with conj on deftype

2014-09-03 Thread kovas boguta
Not a direct answer but you might want to look at https://github.com/ztellman/clj-tuple/blob/master/src/clj_tuple.clj On Wed, Sep 3, 2014 at 1:13 PM, Karsten Schmidt i...@toxi.co.uk wrote: Hi all, I've defined a custom vector type and implemented various clj/cljs protocols, but now ended

Re: ClassCastExecption with conj on deftype

2014-09-03 Thread Karsten Schmidt
Hmm... since ISeq extends IPersistentCollection and overrides the latter's return type, cons must return an ISeq. So do I understand it correctly, that one *can't* have a deftype which returns itself as Seqable *and* has vector-style conj behavior (i.e. append at tail position)? K. On 3

Re: ClassCastExecption with conj on deftype

2014-09-03 Thread Karsten Schmidt
Thanks, Kovas! I looked at it a few months ago (and now just forked it), but Zach also seems to have created a separate deftype just to support this conj-ing business (and that alone is 180 LOC...) That all seems to be a huge effort though and am wondering about simpler alternatives and/or some

Almost purely functional sortable (demo)

2014-09-03 Thread Eldar Gabdullin
Code - https://github.com/dar-clojure/ui/blob/master/examples/sortable/main.cljs Demo - https://dar-clojure.github.io/ui/files/sortable.html You can feed it 1000 items and it's still alive https://dar-clojure.github.io/ui/files/sortable1000.html. What do you think? :) -- You received this

Re: Almost purely functional sortable (demo)

2014-09-03 Thread Andy Fingerhut
On Mac OS X 10.8.5 + Safari 6.1.6, very nice, very slick. On Mac OS X 10.8.5 + Firefox 32.0, very frustrating, and doesn't work like it does on Safari at all. Not sure if that is a known issue or not. Andy On Wed, Sep 3, 2014 at 11:06 AM, Eldar Gabdullin eldar...@gmail.com wrote: Code -

Re: ClassCastExecption with conj on deftype

2014-09-03 Thread kovas boguta
One nuance to consider re: self-sequable datastructures is that on eval clojure will assume the first element is invocable, see https://github.com/ztellman/clj-tuple/issues/5 On Wed, Sep 3, 2014 at 1:51 PM, Karsten Schmidt i...@toxi.co.uk wrote: Thanks, Kovas! I looked at it a few months ago

Re: Almost purely functional sortable (demo)

2014-09-03 Thread Eldar Gabdullin
Thanks, for reporting. Fixed FF issues, now it's at least useable. среда, 3 сентября 2014 г., 22:21:17 UTC+4 пользователь Andy Fingerhut написал: On Mac OS X 10.8.5 + Safari 6.1.6, very nice, very slick. On Mac OS X 10.8.5 + Firefox 32.0, very frustrating, and doesn't work like it does on

Re: Almost purely functional sortable (demo)

2014-09-03 Thread Eldar Gabdullin
It's might be not quite clear, but everything except bangs (!) is a pure data with no state. For example, we have 3 state configurations - initial, captured and dragging. We need to listen a bunch of global events when dragging. When we are done with dragging, we just return an initial state.

StackOverflow TV Opportunity to Promote Clojure

2014-09-03 Thread A. Webb
StackOverflow just announced an experimental project to produce videos in its New York City office. This could be a great opportunity to polish up one of your presentations and promote Clojure to a wide audience. No speaker fees, but reasonable travel costs covered. Post:

[ANN] leaven and bakery - lightweight components for clojure and clojurescript

2014-09-03 Thread Hugo Duncan
leaven [1] is a component library, much like Stuart Sierra's component, only it works for both clojure and clojurescript and is simpler. bakery [2] is a library of leaven components, for both clojure and clojurescript. An example web app [3] uses httpkit, sente, weasel, storage-atom, secretary,

Re: Almost purely functional sortable (demo)

2014-09-03 Thread Eldar Gabdullin
It turns out lags in FF were due to phantom position animation, turning that off makes it working in FF like in Safary and Chrome. среда, 3 сентября 2014 г., 22:48:43 UTC+4 пользователь Eldar Gabdullin написал: Thanks, for reporting. Fixed FF issues, now it's at least useable. среда, 3

Re: [ANN] leaven and bakery - lightweight components for clojure and clojurescript

2014-09-03 Thread Hugo Duncan
The links in my previous post seem to not be correct: [1] https://github.com/palletops/leaven [2] https://github.com/palletops/bakery [3] https://github.com/palletops/bakery/example-web-app signature.asc Description: PGP signature

Re: [ANN] leaven and bakery - lightweight components for clojure and clojurescript

2014-09-03 Thread blake
I'm not sure your [3] URL works. -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from

Re: core.async take behaviour

2014-09-03 Thread Alex Miller
I think that's just a partition transducer on the channel? On Wednesday, September 3, 2014 2:24:28 AM UTC-5, Gary Verhaegen wrote: I'd use another channel on which I put vectors of the correct length, with an intermediate loop that takes from the first channel, accumulates until the vector

Re: ClassCastExecption with conj on deftype

2014-09-03 Thread Armando Blancas
Your implementation of cons in your deftype is probably being associated to the ISeq type, not IPersistentCollection. user= (deftype Foo [a b] #_= clojure.lang.IPersistentCollection #_= (cons [_ c] [a b c])) user.Foo user= (conj (Foo. 1 2) 3) [1 2 3] I think Vector supports ISeq

Re: StackOverflow TV Opportunity to Promote Clojure

2014-09-03 Thread Ashton Kemerling
I tried to email t...@stackoverflow.com and got delivery failure messages. On Wed, Sep 3, 2014 at 1:55 PM, A. Webb a.webb@gmail.com wrote: StackOverflow just announced an experimental project to produce videos in its New York City office. This could be a great opportunity to polish up

Re: [ANN] leaven and bakery - lightweight components for clojure and clojurescript

2014-09-03 Thread Hugo Duncan
dsblakewat...@gmail.com writes: I'm not sure your [3] URL works. Try https://github.com/palletops/bakery/tree/develop/example-web-app signature.asc Description: PGP signature

Re: [ANN] leaven and bakery - lightweight components for clojure and clojurescript

2014-09-03 Thread blake
Yeah, I worked back to the original to find the web-app. I note that the repo seems to default to develop, which results in a lot of errors when I try to lein repl in example-web-app. (Missing clojars which are, in fact, missing.) When I switch branch to the master, I don't get those errors, but

Re: [ANN] leaven and bakery - lightweight components for clojure and clojurescript

2014-09-03 Thread James Reeves
If I'm understanding right, the main difference between Leaven and Component is that Leaven uses *defsystem* to specify an explicit start/stop ordering, while Component uses its *using* function to define dependencies between components, and works out the ordering itself. Also, while this is a

Re: [ANN] leaven and bakery - lightweight components for clojure and clojurescript

2014-09-03 Thread Hugo Duncan
dsblakewat...@gmail.com writes: Yeah, I worked back to the original to find the web-app. I note that the repo seems to default to develop, which results in a lot of errors when I try to lein repl in example-web-app. (Missing clojars which are, in fact, missing.) A `lein install` at the top

Re: [ANN] leaven and bakery - lightweight components for clojure and clojurescript

2014-09-03 Thread Hugo Duncan
ja...@booleanknot.com writes: If I'm understanding right, the main difference between Leaven and Component is that Leaven uses *defsystem* to specify an explicit start/stop ordering, while Component uses its *using* function to define dependencies between components, and works out the

Re: [ANN] leaven and bakery - lightweight components for clojure and clojurescript

2014-09-03 Thread Julio Barros
Thanks Hugo! I was just wishing for something like this for ClojureScript. I look forward to checking it out. Julio On Sep 3, 2014, at 1:19 PM, Hugo Duncan h...@hugoduncan.org wrote: leaven [1] is a component library, much like Stuart Sierra's component, only it works for both clojure

[ANN] *Extended Deadline* CFP for 2014 Scheme and Functional Programming Workshop

2014-09-03 Thread Jason Hemann
The paper submission deadline has been extended one week, to Friday, Sept. 12 23:59 (UTC-12). [Apologies for duplication from cross-postings.] NEW DEADLINE: 12 September 2014, 23:59 (UTC-12) WEBSITE: http://homes.soic.indiana.edu/jhemann/scheme-14/ LOCATION: Washington, DC (co-located with

Re: [ANN] Taoensso library updates / 2014 September

2014-09-03 Thread Peter Taoussanis
Thanks Sun, appreciate all your input on v2.7 - cheers! :-) -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your