overtone / at-at Goto Github PK
View Code? Open in Web Editor NEWAhead-of-time function scheduler
License: Eclipse Public License 1.0
Ahead-of-time function scheduler
License: Eclipse Public License 1.0
I'm getting the following error using the 1.1.1 release:
#<FileNotFoundException java.io.FileNotFoundException: Could not locate overtone/at_at__init.class or overtone/at_at.clj on classpath: >
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.
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?
Details about this can be seen in overtone/overtone#377
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.
Currently, only print-method
is defined:
Line 26 in 392929d
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.
Currently, I need to keep track of the scheduled functions externally and pass them as parameters when re-creating a schedule.
Would be nice to have this instead, as a pause/resume functionality.
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.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.