Never is an awfully long time :-)  If you wait about 60 seconds, the
command you gave calling (future 1) does terminate, at least on Mac OS X
10.8.5 where I tested it, and I have seen the same behavior on Linux and I
think Windows.

This version terminates much more quickly:

java -jar clojure-1.6.0.jar -e "(future 1) (shutdown-agents)"

There is some discussion of this issue at the ClojureDocs page for the
function 'future', including that this issue affects pmap and
clojure.java.shell/sh, too, because are both implemented using futures:

    http://clojuredocs.org/clojure_core/clojure.core/future

It also includes a link to a Clojure ticket suggesting that this behavior
change.  You can vote on it if you like (requires a Clojure JIRA account,
which you can create by clicking on the "Log In" link near the top right of
the page):

    http://dev.clojure.org/jira/browse/CLJ-124

Andy



On Wed, Jul 30, 2014 at 12:33 PM, Serzh Nechyporchuk <nechyporc...@gmail.com
> wrote:

> Hello. I have a problems using code with futures. For example, if I run
> following code:
>
> java -jar clojure-1.6.0.jar -e "(println 1)"
>
> the process prints 1 and terminates.
> But when I'm trying to run code with futures:
>
> java -jar clojure-1.6.0.jar -e "(future 1)"
>
> the process doesn't terminates.
>
> This has real implication when I run some task using
>
> lein run -m some-ns/fun args
>
> If code above uses futures then this process will not terminate. This is
> really frustrating.
>
> --
> 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 this group, send email to
> clojure+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en
> ---
> You received this message because you are subscribed to the Google Groups
> "Clojure" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to clojure+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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 this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to