Re: Future

2018-05-19 Thread Moe Aboulkheir
7;s going on with shutdown-agents, but you could call (run! >> deref ...) to wait for all the futures to complete. >> >> On Sat, May 19, 2018 at 3:29 PM Renata Soares >> wrote: >> >>> Hello, >>> >>> I am using future this way: >>> >

Re: Future

2018-05-19 Thread Renata Soares
> wrote: > >> Hello, >> >> I am using future this way: >> >> (doall (map #(future () (range 1 >> max-size)) >> >> When the max-size is small like around 6, if I don't print (println >> (doall (map #(future () (range 1 >> ma

Re: Future

2018-05-19 Thread Alex Engelberg
Not sure what's going on with shutdown-agents, but you could call (run! deref ...) to wait for all the futures to complete. On Sat, May 19, 2018 at 3:29 PM Renata Soares wrote: > Hello, > > I am using future this way: > > (doall (map #(future () (range 1 max-size)) >

Future

2018-05-19 Thread Renata Soares
Hello, I am using future this way: (doall (map #(future () (range 1 max-size)) When the max-size is small like around 6, if I don't print (println (doall (map #(future () (range 1 max-size))), the result becomes empty (Without print) renata@renata:~/$ lein run ranking {}

Re: what does future do after fn finish ?

2018-02-03 Thread Jacek Grzebyta
HI, So things works well. In terms of memory usage anyway. I use 50 main threads (in process-data-by-condition-set) and 20 for replications (process-growths). However I found that after good performance in the beginning it slows down rapid and quick. VisualVM shows the threads usage is poor - main

Re: what does future do after fn finish ?

2018-02-02 Thread Justin Smith
-> is just a list transform performed after reading your code into a list data structure containing symbols, and before compiling to byte code - it doesn't do anything directly. On Fri, Feb 2, 2018 at 3:55 PM Jacek Grzebyta wrote: > OK I found what makes the memory leak. > > In the project I wor

Re: what does future do after fn finish ?

2018-02-02 Thread Jacek Grzebyta
OK I found what makes the memory leak. In the project I work with I use a java Model class which is java Collection proxy/facade for a single transaction. Unfortunately it's not thread safe. In a few places I passed single instance of model into several threads Also I requested the instance w

Re: what does future do after fn finish ?

2018-02-02 Thread Jacek Grzebyta
On 2 February 2018 at 08:34, Niels van Klaveren wrote: > +1 for Claypoole, it removed the needs of using agents or futures in 95% > of the cases in my code. > > Thanks a lot. I modify the code using claypoole. I imagine with-shutdown will close the pool properly after finish all tasks so there is

Re: what does future do after fn finish ?

2018-02-02 Thread Niels van Klaveren
agents not list of >>> futures within agent. Also any task sent to a agent is processed >>> within a thread anyway so I do not need to add future... >>> >>> On 1 February 2018 at 02:17, John Newman >>> > wrote: >>> >>>> A

Re: what does future do after fn finish ?

2018-02-01 Thread Alan Thompson
should be a list of agents not list of >> futures within agent. Also any task sent to a agent is processed >> within a thread anyway so I do not need to add future... >> >> On 1 February 2018 at 02:17, John Newman wrote: >> >>> Ah, he's using one ag

Re: what does future do after fn finish ?

2018-02-01 Thread Justin Smith
rote: > Thanks folks. I see now! It should be a list of agents not list of futures > within agent. Also any task sent to a agent is processed within a > thread anyway so I do not need to add future... > > On 1 February 2018 at 02:17, John Newman wrote: > >> Ah, he&#x

Re: what does future do after fn finish ?

2018-02-01 Thread Jacek Grzebyta
Thanks folks. I see now! It should be a list of agents not list of futures within agent. Also any task sent to a agent is processed within a thread anyway so I do not need to add future... On 1 February 2018 at 02:17, John Newman wrote: > Ah, he's using one agent, I see. >

Re: what does future do after fn finish ?

2018-01-31 Thread John Newman
2018 8:32 PM, "Justin Smith" wrote: > >> Doing all the actions via one agent means that the actions are serialized >> though - you end up with no performance improvement over doing them all in >> a doseq in one future - the right way to do this tends to be trickier than >

Re: what does future do after fn finish ?

2018-01-31 Thread John Newman
> though - you end up with no performance improvement over doing them all in > a doseq in one future - the right way to do this tends to be trickier than > it looks at first glance, and depends on your requirements. agents, the > claypoole library, and reducers are all potentially useful.

Re: what does future do after fn finish ?

2018-01-31 Thread Justin Smith
Doing all the actions via one agent means that the actions are serialized though - you end up with no performance improvement over doing them all in a doseq in one future - the right way to do this tends to be trickier than it looks at first glance, and depends on your requirements. agents, the

Re: what does future do after fn finish ?

2018-01-31 Thread John Newman
Agents manage a pool of threads for you. Try doing it without the future call and see if that works (unless you're trying to do something else). John On Wed, Jan 31, 2018 at 7:31 PM, Jacek Grzebyta wrote: > Thanks a lot. I will check it tomorrow. > > J > > On 1 Feb 2018

Re: what does future do after fn finish ?

2018-01-31 Thread Jacek Grzebyta
Thanks a lot. I will check it tomorrow. J On 1 Feb 2018 12:12 a.m., "Justin Smith" wrote: > this is exactly the kind of problem code I was describing - there's no > backpressure on existing future tasks to hold up the launching of more > futures - the work done by t

Re: what does future do after fn finish ?

2018-01-31 Thread Justin Smith
this is exactly the kind of problem code I was describing - there's no backpressure on existing future tasks to hold up the launching of more futures - the work done by the agent calling conj is negligible. You need to control the size of the pool of threads used, and you need to impose

Re: what does future do after fn finish ?

2018-01-31 Thread Jacek Grzebyta
On 31 January 2018 at 18:08, James Reeves wrote: > On 31 January 2018 at 17:59, Jacek Grzebyta > wrote: > >> I have application with quite intense tripe store populating ~30/40 k >> records per chunk (139 portions). The data are wrapped within the future: >> >>

Re: what does future do after fn finish ?

2018-01-31 Thread Justin Smith
As a shot in the dark, a common problem with memory usage and futures that I have seen is the antipattern of launching a future for each piece of data in a collection. The problem that occurs is that the code works for small input collections and a small load of running tasks / requests, but for a

Re: what does future do after fn finish ?

2018-01-31 Thread James Reeves
On 31 January 2018 at 17:59, Jacek Grzebyta wrote: > I have application with quite intense tripe store populating ~30/40 k > records per chunk (139 portions). The data are wrapped within the future: > > (conj agent (future (apply task args))) > > and that all together is se

what does future do after fn finish ?

2018-01-31 Thread Jacek Grzebyta
Hi, I have application with quite intense tripe store populating ~30/40 k records per chunk (139 portions). The data are wrapped within the future: (conj agent (future (apply task args))) and that all together is send-off into (agent []). At the end of the main thread function I just use await

Re: Did something change in future

2017-08-20 Thread Alan Moore
Cecil, Welcome back! I remember your name from prior posts. Hope it goes well for you. The tooling has improved substantially and a lot of the rough edges have been sanded down, especially for ClojureScript which has undergone huge improvements. Clojure (and ClojureScript) FTW! Alan -- You r

Re: Did something change in future

2017-08-19 Thread Cecil Westerhof
2017-08-20 1:57 GMT+02:00 Sean Corfield : > And, yes, definitely, you should pick up Clojure again!! > ​:-D -- Cecil Westerhof -- 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

Re: Did something change in future

2017-08-19 Thread Cecil Westerhof
2017-08-20 1:54 GMT+02:00 Sean Corfield : > I’d hazard a guess that something inside the future --- perhaps the > search-quotes function call? – is throwing an exception and that’s just > being “swallowed” because it’s in another thread. > > > > As a general rule of thumb to

RE: Did something change in future

2017-08-19 Thread Sean Corfield
ugust 19, 2017 2:38 PM To: clojure@googlegroups.com Subject: Did something change in future Quit some time ago I wrote a Clojure program. In it I used future to display a swing window like:     (defn show-search-quotes   [search-str]   (debug-info "show-search-quotes enter")  

RE: Did something change in future

2017-08-19 Thread Sean Corfield
I’d hazard a guess that something inside the future --- perhaps the search-quotes function call? – is throwing an exception and that’s just being “swallowed” because it’s in another thread. As a general rule of thumb to debug any issues with futures, replace future with identity and see what

Did something change in future

2017-08-19 Thread Cecil Westerhof
Quit some time ago I wrote a Clojure program. In it I used future to display a swing window like: (defn show-search-quotes [search-str] (debug-info "show-search-quotes enter") (future (info-table (format "Search Quotes (Case Independent):

Re: how to be notified when a Future is realized?

2017-08-03 Thread James Gatannah
point. But my third (and, for now, final) reaction was "Why not just supply a callback?" Think 1 is (hopefully) going to finish at some point in time in the future. It's nice (in theory) to be able to say "Stop processing here until some other thread toggles this flag.&quo

Re: how to be notified when a Future is realized?

2017-08-02 Thread Alf
> > wrote: > >> I stumbled across this old post by Tomasz Nurkiewicz: >> >> http://www.nurkiewicz.com/2013/03/promises-and-futures-in-clojure.html >> >> He writes: >> >> "And here is where the greatest disappointment arrives: neither future &g

Re: how to be notified when a Future is realized?

2017-08-02 Thread Leonardo Borges
2, 2017 at 2:09 PM wrote: > I stumbled across this old post by Tomasz Nurkiewicz: > > http://www.nurkiewicz.com/2013/03/promises-and-futures-in-clojure.html > > He writes: > > "And here is where the greatest disappointment arrives: neither future > <http://clojuredocs.

Re: how to be notified when a Future is realized?

2017-08-02 Thread Justin Smith
wrote: > I stumbled across this old post by Tomasz Nurkiewicz: > > http://www.nurkiewicz.com/2013/03/promises-and-futures-in-clojure.html > > He writes: > > "And here is where the greatest disappointment arrives: neither future > <http://clojuredocs.org/clojure_core/

how to be notified when a Future is realized?

2017-08-02 Thread lawrence . krubner
I stumbled across this old post by Tomasz Nurkiewicz: http://www.nurkiewicz.com/2013/03/promises-and-futures-in-clojure.html He writes: "And here is where the greatest disappointment arrives: neither future <http://clojuredocs.org/clojure_core/clojure.core/future> nor pro

Re: [ANN] clojure-future-spec, a backport of clojure.spec for 1.8

2016-09-25 Thread Matan Safriel
Cool!! Sent from my mobile Original Message From:Nikita Prokopov Sent:Sun, 25 Sep 2016 11:52:19 +0300 To:Clojure Subject:Re: [ANN] clojure-future-spec, a backport of clojure.spec for 1.8 >Matan, > > >spec is pretty isolated part of Clojure, so it’s basically a co

Re: [ANN] clojure-future-spec, a backport of clojure.spec for 1.8

2016-09-25 Thread Nikita Prokopov
your production to alpha >> version of the language, you can add clojure.spec capabilities as a library >> to 1.8: >> >> https://github.com/tonsky/clojure-future-spec >> >> :dependencies [ >> [org.clojure/clojure "1.8.0"] >> [clojure

Re: [ANN] clojure-future-spec, a backport of clojure.spec for 1.8

2016-09-23 Thread Matan Safriel
capabilities as a library > to 1.8: > > https://github.com/tonsky/clojure-future-spec > > :dependencies [ > [org.clojure/clojure "1.8.0"] > [clojure-future-spec "1.9.0-alpha8"] > ] > > (require '[clojure.spec :as spec]) > (requi

Re: Future of spec/explain-data, spec/and, etc.

2016-07-25 Thread Mars0i
On Monday, July 25, 2016 at 10:56:09 AM UTC-5, Mars0i wrote: > > just noticed this morning that :path is explained in "clojure.spec - > Rationale and Overview". > There's also material about :path in your Spec Guide, but I had not fully understood it. I get it now--at least up to the level of

Re: Future of spec/explain-data, spec/and, etc.

2016-07-25 Thread Mars0i
ta's return value in some >> situations, such as when specs are combined using spec/keys or spec/or. In >> other situations--at least when specs are combined with spec/and, the:path >> values are empty. Unlike spec/or, there's no way to specify keywords that >

Re: Future of spec/explain-data, spec/and, etc.

2016-07-24 Thread Alex Miller
gt; values are empty. Unlike spec/or, there's no way to specify keywords that > would identify the failed test. > > Am I right that explain-data is in flux? Is the goal that in the future, > it will always be possible for developers to specify composite specs in > such a

Future of spec/explain-data, spec/and, etc.

2016-07-24 Thread Mars0i
least when specs are combined with spec/and, the:path values are empty. Unlike spec/or, there's no way to specify keywords that would identify the failed test. Am I right that explain-data is in flux? Is the goal that in the future, it will always be possible for developers to specify c

Re: [ANN] clojure-future-spec, a backport of clojure.spec for 1.8

2016-07-01 Thread Sam Estep
ar namespace dependencies. > > > > Sean Corfield -- (904) 302-SEAN > An Architect's View -- http://corfield.org > > > > *From: *Sam Estep > *Sent: *Thursday, June 30, 2016 9:36 PM > *To: *Clojure > *Subject: *Re: [ANN] clojure-future-spec, a backport o

RE: [ANN] clojure-future-spec, a backport of clojure.spec for 1.8

2016-06-30 Thread sean
I can’t help but think you’re making it way more complicated than it needs to be. Define ::config in example.spec, and in example.core use :example.spec/config (and, yes, require the example.spec namespace). You need to avoid circular namespace dependencies. Sean Corfield -- (904) 302-SEAN An

Re: [ANN] clojure-future-spec, a backport of clojure.spec for 1.8

2016-06-30 Thread Sam Estep
I spent quite a while trying to figure out how I can use some features of spec, like destructuring, to work properly when my specs are in a separate namespace. I asked a question about this on Stack Overflow; do you have any advice on how to solve th

Re: [ANN] clojure-future-spec, a backport of clojure.spec for 1.8

2016-06-30 Thread Lucas Bradstreet
Thanks Sean. You make an excellent point with specs being in a separate namespace. I had thought that using fdef would have prevented doing something like this but it appears I am wrong. On 30 June 2016 at 01:20, Sean Corfield wrote: > On 6/29/16, 10:03 AM, "Lucas Bradstreet" of lucasbradstr...@

Re: [ANN] clojure-future-spec, a backport of clojure.spec for 1.8

2016-06-29 Thread Sean Corfield
On 6/29/16, 10:03 AM, "Lucas Bradstreet" wrote: > Sean, a lot of library developers still want to support Clojure 1.8, > but this would prevent using spec with their projects. clojure.java.jdbc solves that by having the specs in a separate namespace (and by the tests conditionally loading that a

Re: [ANN] clojure-future-spec, a backport of clojure.spec for 1.8

2016-06-29 Thread Lucas Bradstreet
proko...@gmail.com> wrote: > > > > Hi! > > > > Not sure if a good idea or bad, but if you were eager to play with latest > version of clojure.spec but don’t want to upgrade your production to alpha > version of the language, you can add clojure.spec c

Re: [ANN] clojure-future-spec, a backport of clojure.spec for 1.8

2016-06-29 Thread Sean Corfield
want to upgrade your production to alpha version of the language, you can add clojure.spec capabilities as a library to 1.8: https://github.com/tonsky/clojure-future-spec :dependencies [ [org.clojure/clojure "1.8.0"] [clojure-future-spec "1.9.0-alpha8&quo

[ANN] clojure-future-spec, a backport of clojure.spec for 1.8

2016-06-29 Thread Nikita Prokopov
Hi! Not sure if a good idea or bad, but if you were eager to play with latest version of clojure.spec but don’t want to upgrade your production to alpha version of the language, you can add clojure.spec capabilities as a library to 1.8: https://github.com/tonsky/clojure-future-spec

Re: ANN Ogre 3.0.0.0-beta1 and future plans for Ogre

2016-06-17 Thread Skott Klebe
I've really been looking forward to digging into this. Right now -- and with full awareness of the -beta1 tag on the version number -- I'm having a lot of trouble. First, and seemingly minor, lein install failed on the following - .../ogre/test/java/org/clojurewerkz/ogre/gremlin/process/OgreProc

ANN Ogre 3.0.0.0-beta1 and future plans for Ogre

2016-06-15 Thread Michael Klishin
Ogre [1] is a Clojure dialect of Gremlin, a DSL for querying and otherwise working with Apache TinkerPop [2] graphs. Over the last 6 months or so Ogre maintainers have moved it to target TinkerPop 3.x. Since TinkerPop itself has changed quite a bit and is now an Apache incubator project, Ogre API

Re: Using a try catch inside a future

2016-04-29 Thread Ashish Negi
Also, it means that bug is not in future or threads but in threaded-function itself which is swallowing all the exceptions.. Future is cancelled but it is just that bad-thread is not stopping. -- You received this message because you are subscribed to the Google Groups "Clojure" grou

Re: Using a try catch inside a future

2016-04-29 Thread Ashish Negi
https://docs.oracle.com/javase/7/docs/api/java/util/concurrent/Future.html#cancel%28boolean%29 may explain why future-cancelled? is returning true.. After this method returns, subsequent calls to isDone() <https://docs.oracle.com/javase/7/docs/api/java/util/concurrent/Future.html#isDone%28

Re: Using a try catch inside a future

2016-04-29 Thread Dan Burton
Ah, the weirdness was because I forgot to make future-try wait for the future it creates. (defmacro future-try [& body] `(let [thread-atom# (atom nil)] (try (reset! thread-atom# (future (try ~@body))) *@@thread-atom#* (catch Exception e# (if-let [th

Re: Using a try catch inside a future

2016-04-29 Thread Dan Burton
Here's something to explore. (defmacro future-try [& body] `@(future (try ~@body))) (defn test-f2 [initial-v] (let [n (atom initial-v)] [n (future (while (not (Thread/interrupted)) (future-try (Thread/sleep 5000) (sw

Re: Using a try catch inside a future

2016-04-29 Thread Dan Burton
hread is never stopped.. and > hence future-cancel returns false. > > If you throw again.. exception would unwind your while loop and stop the > thread. > hence.. future-cancel is able to stop the thread and returns true. > > -- > You received this message because you are sub

Re: Using a try catch inside a future

2016-04-29 Thread Tom Bodenheimer
Hi Ashish, It actually appears that there is no exception thrown by default when future-cancel is called on the thread *unless* you manage to overlook java functions that include some type of interrupt status handling. As I managed to do. Take a look at my below test-interrupt-status-2 that

Re: Using a try catch inside a future

2016-04-29 Thread Tom Bodenheimer
he key to my misunderstanding is right there is the InterruptedException doc - the interrupted status is cleared by Thread/sleep. The remaining surprise is that the future-cancel call actually returns true for all the cases (which is different from what I originally wrote). Check out the below examples

Re: Using a try catch inside a future

2016-04-29 Thread Ashish Negi
hence future-cancel returns false. If you throw again.. exception would unwind your while loop and stop the thread. hence.. future-cancel is able to stop the thread and returns true. -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to

Using a try catch inside a future

2016-04-28 Thread Tom Bodenheimer
Hi all, I have recently been playing with futures and have stumbled on the following situation. (defn test-f1 [initial-v] (let [n (atom initial-v)] [n (future (while (not (Thread/interrupted)) (Thread/sleep 5000) (swap! n inc) (println @n

Re: Is there a function in clojure.test like future fact in midje?

2016-02-29 Thread Timothy Baldridge
ntly and I would like to mark >>> it as TODO. >>> Currently I comment it out. >>> >>> Is there a function in clojure.test which says this test is not ready >>> yet, log the output but don't test it. >>> Similar to future fact in midje[1]

Re: Is there a function in clojure.test like future fact in midje?

2016-02-29 Thread Timothy Baldridge
Jain wrote: >> >> Hi, >> >> I have a deftest but its output fails currently and I would like to mark >> it as TODO. >> Currently I comment it out. >> >> Is there a function in clojure.test which says this test is not ready >> yet, log the outpu

Re: Is there a function in clojure.test like future fact in midje?

2016-02-29 Thread Andrea Richiardi
wrote: > > Hi, > > I have a deftest but its output fails currently and I would like to mark > it as TODO. > Currently I comment it out. > > Is there a function in clojure.test which says this test is not ready yet, > log the output but don't test it. >

Is there a function in clojure.test like future fact in midje?

2016-02-29 Thread Mayank Jain
Hi, I have a deftest but its output fails currently and I would like to mark it as TODO. Currently I comment it out. Is there a function in clojure.test which says this test is not ready yet, log the output but don't test it. Similar to future fact in midje[1]? Thanks. [1] :

Re: clojure future method

2016-02-15 Thread Mike Sassak
Is the future returning a lazy seq? You might need to walk the seq with doseq / dorun etc. On Mon, Feb 15, 2016, 6:02 AM Gary Verhaegen wrote: > `future` starts a function in a separate thread, which comes out of a > thread pool. It may not be that easy to check if a future has run at &g

Re: clojure future method

2016-02-15 Thread Gary Verhaegen
`future` starts a function in a separate thread, which comes out of a thread pool. It may not be that easy to check if a future has run at all if you don't hold onto the future object and wait for it. How did you check if they run? It's possible, for example, that they are sending the

clojure future method

2016-02-15 Thread Punit Naik
I have a function which calls a number of functions in sequence. Few of them are normal functions and some of them use clojure's 'future' method. When I run this function, All the normal fuctions run but the functions which use 'future' don't run at all. But if

Re: Heard about clojure today. is it one of the big tecnologies for the future? or is it becoming deprecated?

2016-01-21 Thread henry w
Miguel, it's one of the big technologies of the future, definitely! :-) On Wednesday, January 20, 2016 at 4:07:22 PM UTC, Miguel Domingos wrote: > > Hi, > > Just checked GIT Hub Pulse and it is very low. I just heard about this > technology today, so I don't know. >

Re: Heard about clojure today. is it one of the big tecnologies for the future? or is it becoming deprecated?

2016-01-21 Thread Herwig Hochleitner
2016-01-20 17:04 GMT+01:00 Miguel Domingos : > Just checked GIT Hub Pulse and it is very low. I just heard about this > technology today, so I don't know. > https://github.com/clojure/clojure/pulse > The fact that clojure's language core has very little churn actually makes the language quite pl

Re: Heard about clojure today. is it one of the big tecnologies for the future? or is it becoming deprecated?

2016-01-20 Thread Alex Miller
Each of the Clojure confs is in the 400-600 range and there are over 10k people on this list and about 4500 on Clojurians slack last time I looked. -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegro

Re: Heard about clojure today. is it one of the big tecnologies for the future? or is it becoming deprecated?

2016-01-20 Thread Andy Fingerhut
That repository you did the Pulse graph on contains basically what you would think of in the core implementation of Python/Ruby/etc. with only the most minimal of libraries included. No extra modules/gems/etc. The libraries of Clojure are all spread across many other repositories, and Clojure was

Re: Heard about clojure today. is it one of the big tecnologies for the future? or is it becoming deprecated?

2016-01-20 Thread kovas boguta
Most of Clojure development activity happens in JIRA http://dev.clojure.org/jira/browse/CLJ If you want a sense of overall community activity, check https://github.com/search?l=Clojure&o=desc&q=clojure&s=updated&type=Repositories&utf8=%E2%9C%93 On Wed, Jan 20, 2016 at 11:35 AM, Andy Fingerhut wr

Re: Heard about clojure today. is it one of the big tecnologies for the future? or is it becoming deprecated?

2016-01-20 Thread Max Countryman
Clojure is not becoming deprecated. A major release happened just yesterday in fact. > On Jan 20, 2016, at 08:04, Miguel Domingos > wrote: > > Hi, > > Just checked GIT Hub Pulse and it is very low. I just heard about this > technology today, so I don't know. > https://github.com/clojure/clo

Heard about clojure today. is it one of the big tecnologies for the future? or is it becoming deprecated?

2016-01-20 Thread Miguel Domingos
Hi, Just checked GIT Hub Pulse and it is very low. I just heard about this technology today, so I don't know. https://github.com/clojure/clojure/pulse Thanks, Miguel -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email

Re: Edn, Fressian, Transit: which of these formats have a future?

2015-03-20 Thread Ryan Schmitt
gt; > To answer the big question, all of these data formats are in active use at > Cognitect and while I make no promises, I expect them all to be alive and > active for the knowable future. Each of them targets a different niche but > all of them share the qualities of transmitting e

Re: Edn, Fressian, Transit: which of these formats have a future?

2015-03-20 Thread Ryan Schmitt
Nippy looks like an interesting project; I wasn't familiar with it. However, it seems to be very Clojure-centric. Which is fine, at least for certain use cases; it just doesn't really occupy the part of the serialization format design space that I'm most interested in for dynamic-object. On Mo

Re: Edn, Fressian, Transit: which of these formats have a future?

2015-03-17 Thread Andrey Antukh
+1 nippy I have successfully used it in few of my projects. 2015-03-17 5:30 GMT+01:00 Lucas Bradstreet : > I have had a lot of success with nippy > https://github.com/ptaoussanis/nippy, which is quite well documented. We > had problems with fressian round tripping Clojure collections, as you've >

Re: Edn, Fressian, Transit: which of these formats have a future?

2015-03-16 Thread Lucas Bradstreet
I have had a lot of success with nippy https://github.com/ptaoussanis/nippy, which is quite well documented. We had problems with fressian round tripping Clojure collections, as you've described. It has a number of other features (compression, encryption) that I may end up using. It has given a

Re: Edn, Fressian, Transit: which of these formats have a future?

2015-03-15 Thread Alex Miller
Hi Ryan, To answer the big question, all of these data formats are in active use at Cognitect and while I make no promises, I expect them all to be alive and active for the knowable future. Each of them targets a different niche but all of them share the qualities of transmitting extensible

Edn, Fressian, Transit: which of these formats have a future?

2015-03-15 Thread Ryan Schmitt
I'm the author of dynamic-object , an open source library that makes Clojure's data modeling power available to Java programmers. This includes features like serialization and deserialization. I'll copy this small usage example from the README to give

Would it be better to move future to the called function

2015-03-02 Thread Cecil Westerhof
I have a function info-table to display the output of a query. I have statements like the following: (defn show-all-quotes [] (future (info-table "All Quotes" '(:quote "Quote" :author "Author") (all-quo

Re: atoms, memoize, future-s and CAS

2014-12-20 Thread Andy L
learned that using future (or essentially Java threads) is so poor approach to scalability. derefing memoized delay of my function wrapped with future worked well to some point. After pushing it a bit with more concurrent tasks, my JVM started freezing under pressure of to many threads. I ended up with

Re: atoms, memoize, future-s and CAS

2014-12-08 Thread Michał Marczyk
On 8 December 2014 at 21:46, Fluid Dynamics wrote: > [...] > Which means it's locking or bust. You just get to either do the locking > yourself or delegate :) Sure, but isn't it nice when somebody else does your locking for you? :-) Incidentally, there is a trade-off here between lockless reads

Re: atoms, memoize, future-s and CAS

2014-12-08 Thread Michał Marczyk
Oh, and as for how to use it here, you could for example say (.putIfAbsent concurrent-hash-map :foo (delay (foo))) Then the first thread to @(get concurrent-hash-map :foo (delay :not-found)) (or similar) would actually compute the value. With a map in an atom, you could swap! using a function

Re: atoms, memoize, future-s and CAS

2014-12-08 Thread Fluid Dynamics
On Monday, December 8, 2014 3:34:05 PM UTC-5, Michał Marczyk wrote: > > On 8 December 2014 at 17:54, Andy L > > wrote: > >> But I'd personally just use a delay rather than "locking" for this > >> purpose. > > > > > > It is not that I like locking at all. However I still fail to see, how > in

Re: atoms, memoize, future-s and CAS

2014-12-08 Thread Michał Marczyk
On 8 December 2014 at 17:54, Andy L wrote: >> But I'd personally just use a delay rather than "locking" for this >> purpose. > > > It is not that I like locking at all. However I still fail to see, how in a > multithreaded context memoize/cache prevents executing a given function more > than once

Re: atoms, memoize, future-s and CAS

2014-12-08 Thread Andy L
che code (btw an excellent exercise) , and I think I understand how persistent data structure/atom is employed here in case we deal with side effects free functions. > You could write this as a function. There's nothing in there that requires > a macro. > > (defn when-map-future-s

Re: atoms, memoize, future-s and CAS

2014-12-07 Thread James Reeves
ations in core.cache have no side-effects. They simply return a new cache rather than overwriting the old one. The memoize library places the cache in an atom, so it's guaranteed to change atomically. > So I ended up with this (this is my first LISP macro ever, so please be > gentle

Re: atoms, memoize, future-s and CAS

2014-12-06 Thread Andy L
or even better (using future themselves as a "marker" in the atom): (defmacro map-future-swap! [a k f] `(locking ~a (when (not (contains? @~a ~k)) (swap! ~a assoc ~k (future (swap! ~a assoc ~k (~f ~k ) ) ) -- You received this message because you are

Re: atoms, memoize, future-s and CAS

2014-12-06 Thread Andy L
ation, but again I could be wrong. Or it might not be needed for 99.99% cache use cases. Also, at that point I would like to avoid to "defcache" my own version. So I ended up with this (this is my first LISP macro ever, so please be gentle :-) : (defmacro when-map-future-swap! [a k f] `

Re: atoms, memoize, future-s and CAS

2014-12-06 Thread James Reeves
On 7 December 2014 at 01:13, Andy L wrote: > > Thanks for looking into that. This indeed would solve a "semantics" > problem of memoize, as it returns a value now. However, it seems that > clojure.core.memoize, > or rather clojure.core.cache memoize is based of, is not thread safe. > > It uses C

Re: atoms, memoize, future-s and CAS

2014-12-06 Thread Andy L
> (defn memoized [f] > (comp deref (memoize (fn [& args] (delay (apply f args) > > Thanks for looking into that. This indeed would solve a "semantics" problem of memoize, as it returns a value now. However, it seems that clojure.core.memoize, or rather clojure.core.cache memoize is based of,

Re: atoms, memoize, future-s and CAS

2014-12-06 Thread James Reeves
use memoize, however I do not think its > semantics fit well into this case, since the result is a "side-effect" on > an atom as opposed to return value. > > The easiest solution, is to create another atom with a map of the > arguments into a "state". If some other

atoms, memoize, future-s and CAS

2014-12-06 Thread Andy L
turn value. The easiest solution, is to create another atom with a map of the arguments into a "state". If some other "future" is already there working hard on the problem, we simply bail. However, that leads to another problem. "compare-and-set!" just operates on atom

Re: Future termination

2014-08-20 Thread Serzh Nechyporchuk
t terminate, even after an hour? I may try collecting some info like > this to add to the Clojure ticket. In particular, the outputs of the > following commands. > > java -version > uname -a > lsb_release -d > time java -jar clojure-1.6.0.jar -e "(future 1) (shutdown

Re: Future termination

2014-07-31 Thread Andy Fingerhut
clojure-1.6.0.jar -e "(future 1) (shutdown-agents)" time java -jar clojure-1.6.0.jar -e "(future 1)" For that last one, if it runs more than 2 minutes without terminating, you can kill it. No need to wait for an hour. I have tried Ubuntu 14.04 desktop 64-bit running in a VM on

Re: Future termination

2014-07-31 Thread Serzh Nechyporchuk
ime :-) 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

Re: Future termination

2014-07-30 Thread Andy Fingerhut
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

Future termination

2014-07-30 Thread Serzh Nechyporchuk
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 p

Re: Future of performant software: cores or memory?

2014-07-17 Thread Mark Phillips
rote: > >> I have watched a number of clojure talks where the concurrent programming >> benefits of Clojure are emphasized. People have suggested that the number >> of cores in computers is growing with an exponential trend. Software >> developers will need programmin

Re: Past and future of data.generators

2014-06-07 Thread Mars0i
For the record, I just did some simple speed comparisons of sampling functions from Incanter, data.generators, and bigml/sampling, and data.generators performs very well. It was fastest in some tests. -- You received this message because you are subscribed to the Google Groups "Clojure" group

  1   2   3   4   >