Git Product home page Git Product logo

at-at's Issues

Reflection warnings

First of all, thank you for the library!

We can still see some reflection warnings using your library:

Reflection warning, overtone/at_at.clj:15:3 - reference to field printStackTrace can't be resolved.
Reflection warning, overtone/at_at.clj:211:16 - call to java.util.concurrent.ScheduledThreadPoolExecutor ctor can't be resolved.

I believe it would be a good idea to add a call to (set! *warn-on-reflection* true) in the test suite or something like that to avoid regressions.

Cannot import from leiningen 2.0 dependency

I have the following in my project.clj

[overtone/at-at "1.1.1"]

And running lein deps gave no errors and I have confirmed that at-at is on my classpath (lein classpath | grep "at-at") however when I try to use:

(use 'at-at)
or (use 'overtone/at-at)

It results in:

Exception in thread "main" java.io.FileNotFoundException: Could not locate at_at__init.class or at_at.clj on classpath

Happens also when putting it in the namespace. Thoughts?

Expose exceptions in scheduled functions

At the moment, if a scheduled function throws an exception it fails silently.

(def tp (at-at/mk-pool))

(defn -main [& args]
  (at-at/every 1000 #(throw (Exception. "You'll never see me"))
               tp :desc "My job")
  (Thread/sleep 3000)
  (System/exit 0))

This can be confusing and make it appear that the function isn't running.

Ideally I'd like to see output like this:

at-at task [1][RECUR] "My job" threw java.lang.Exception: You'll never see me
at-at task [1][RECUR] "My job" threw java.lang.Exception: You'll never see me
at-at task [1][RECUR] "My job" threw java.lang.Exception: You'll never see me

Another option would be to fail fast by re-raising the exception and crashing the program, which would at least indicate that the user needs to handle an error case.

`clojure.pprint/simple-dispatch` needs to be implemented for self-referrential types

Currently, only print-method is defined:

(defmethod print-method RecurringJob

This still causes StackOverflowError when pretty printing these types (the cycle I saw was in java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask, which may belong to :pool-info). The clojure.pprint/simple-dispatch impl may simply call print to dispatch to the print-method.

Repro:

(let [pool (overtone.at-at/mk-pool)]
  (try
    (let [job (overtone.at-at/every 1000 #(println "sched") pool)]
      ;(clojure.pprint/pprint pool) ;; StackOverflow
      (clojure.pprint/pprint job) ;; also
      )
    (finally 
      (overtone.at-at/stop-and-reset-pool! pool))))

I haven't tried other types.

add 'stop-pool!' function

I'd like a way to shutdown a thread pool without also resetting it. Currently, I have to just call stop-and-reset-pool!, which shuts down the the pool (good) but also creates a new thread pool, which I don't actually want to happen, since I'm calling this in the context of shutting down the entire application.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.