(.schedule sched "* * * * *" #(println "Hello, World!"))
"dca735307ae35bb7649a8a680124bec35ff926b54d06"
user=> (.start sched)
On Oct 30, 4:05 am, Stefan Arentz wrote:
> What is a good and simple way to run periodic tasks in Clojure? I need
> to run a simple functio
> I'd love to hear success stories from people using nailgun to actually
> run frequent scripted tasks out of cron, as opposed to for
> development. It would make clojure more palatable for my work
> environment.
Nailgun has been a boon to me. I don't believe Nailgun has a problem
with dynamic cl
On Sun, Nov 1, 2009 at 7:39 PM, Jonathan Smith
wrote:
>
> Maybe I'm confused, but can't you just do a regular java thread for
> this?
>
> (defn periodicly [fun time]
> "starts a thread that calls function every time ms"
> (let [thread (new Thread (fn [] (loop [] (fun) (Thread/sleep time)
> (recur
fan Arentz wrote:
> What is a good and simple way to run periodic tasks in Clojure? I need
> to run a simple function every couple of minutes. And make sure that
> if it throws an exception that it won't kill the periodic task.
>
> I come from a Spring world where XML, Timer
On Sun, Nov 1, 2009 at 3:20 PM, Emeka wrote:
> John,
>
> Is like I am missing something? This thread mentioned making periodic
> tasks, there was a java example to it. However, what you posted I am yet to
> figure out how to make a periodic tasks possible.
>
Agents can perf
John,
Is like I am missing something? This thread mentioned making periodic tasks,
there was a java example to it. However, what you posted I am yet to figure
out how to make a periodic tasks possible.
Regards,
Emeka
On Sat, Oct 31, 2009 at 6:27 PM, John Harrop wrote:
> On Sat, Oct 31, 2
On Sat, Oct 31, 2009 at 12:36 PM, Luke VanderHart wrote:
> Why not just run an agent that does something, then calls sleep for N
> seconds, then calls the next thing?
>
> Granted, it will eat up a thread in your agent thread pool, but if
> you've only got one of these in the app it shouldn't be a
On Oct 31, 11:42 am, Richard Newman wrote:
> VimClojure relies on Nailgun, with a bunch of people on this list
> using it with Clojure every day.
My recollection from list and IRC was that (aside from random nailgun
issues + the project not being updated in 4 years) there was an issue
with d
>
> Overhead from starting and stopping the JVM every couple of minutes
> would probably be unacceptable. My understanding is that solutions
> like Nailgun don't work correctly with Clojure either.
VimClojure relies on Nailgun, with a bunch of people on this list
using it with Clojure every da
t a daemon thread manually.
-Luke
On Oct 30, 12:05 am, Stefan Arentz wrote:
> What is a good and simple way to run periodic tasks in Clojure? I need
> to run a simple function every couple of minutes. And make sure that
> if it throws an exception that it won't kill the periodic
On Oct 31, 5:22 am, alxtoth wrote:
> Why not use the OS task scheduler? On un*x there is good old cron or
> at. On windoze there is similar task scheduler.
>
Overhead from starting and stopping the JVM every couple of minutes
would probably be unacceptable. My understanding is that solutions
iles , and rotate those files sometimes.
I am sure there are more fancy solutions than cron, and some that
don't require megabytes of XML as the usual Java stuff
-Alex
On Oct 30, 6:05 am, Stefan Arentz wrote:
> What is a good and simple way to run periodic tasks in Clojure? I need
On 30 Oct, 16:18, Albert Cardona wrote:
> How about:
>
> (import '(java.util.concurrent Executors TimeUnit))
..
> Admittedly very java-ish.
Personally, I think Java-ish is the way to go here. John's actor lib
is pretty nifty, but it is relying on implementation details of the
threading o
How about:
(import '(java.util.concurrent Executors TimeUnit))
(let [s (Executors/newSingleThreadScheduledExecutor)]
(.scheduleAtFixedRate s
#(try
(println "I did it again")
(catch Exception e
(.printStackTrace e)))
(long 0)
(long 1)
TimeUnit/SECONDS))
Adm
On Fri, Oct 30, 2009 at 12:05 AM, Stefan Arentz wrote:
> What is a good and simple way to run periodic tasks in Clojure? I need
> to run a simple function every couple of minutes. And make sure that
> if it throws an exception that it won't kill the periodic task.
>
> I come
What is a good and simple way to run periodic tasks in Clojure? I need
to run a simple function every couple of minutes. And make sure that
if it throws an exception that it won't kill the periodic task.
I come from a Spring world where XML, Timers, Jobs and Quartz rule the
world,
16 matches
Mail list logo