{"id":19785683,"url":"https://github.com/overtone/at-at","last_synced_at":"2025-04-13T01:59:56.665Z","repository":{"id":61593634,"uuid":"2185340","full_name":"overtone/at-at","owner":"overtone","description":"Ahead-of-time function scheduler","archived":false,"fork":false,"pushed_at":"2024-10-19T19:26:43.000Z","size":70,"stargazers_count":294,"open_issues_count":1,"forks_count":37,"subscribers_count":13,"default_branch":"master","last_synced_at":"2025-04-10T00:17:12.746Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Clojure","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"epl-1.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/overtone.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2011-08-10T13:48:26.000Z","updated_at":"2025-03-23T22:10:15.000Z","dependencies_parsed_at":"2023-12-07T17:41:27.938Z","dependency_job_id":"4aa4dbcb-a459-4624-84fe-63d5afc4f891","html_url":"https://github.com/overtone/at-at","commit_stats":{"total_commits":28,"total_committers":7,"mean_commits":4.0,"dds":0.25,"last_synced_commit":"392929d617e28f8671ae2a79bc5809c87b4453bc"},"previous_names":[],"tags_count":11,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/overtone%2Fat-at","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/overtone%2Fat-at/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/overtone%2Fat-at/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/overtone%2Fat-at/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/overtone","download_url":"https://codeload.github.com/overtone/at-at/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248648072,"owners_count":21139215,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-12T06:15:26.980Z","updated_at":"2025-04-13T01:59:56.634Z","avatar_url":"https://github.com/overtone.png","language":"Clojure","funding_links":[],"categories":["\u003ca name=\"Clojure\"\u003e\u003c/a\u003eClojure"],"sub_categories":[],"readme":"                                            ________\n                                        _,.-Y  |  |  Y-._\n                                    .-~\"   ||  |  |  |   \"-.\n                                    I\" \"\"==\"|\" !\"\"! \"|\"[]\"\"|     _____\n                                    L__  [] |..------|:   _[----I\" .-{\"-.\n                                   I___|  ..| l______|l_ [__L]_[I_/r(=}=-P\n                                  [L______L_[________]______j~  '-=c_]/=-^\n                                   \\_I_j.--.\\==I|I==_/.--L_]\n                                     [_((==)[`-----\"](==)j\n                                        I--I\"~~\"\"\"~~\"I--I\n                                        |[]|         |[]|\n                                        l__j         l__j\n                                        |!!|         |!!|\n                                        |..|         |..|\n                                        ([])         ([])\n                                        ]--[         ]--[\n                                        [_L]         [_L]  -Row\n                                       /|..|\\       /|..|\\\n                                      `=}--{='     `=}--{='\n                                     .-^--r-^-.   .-^--r-^-.\n                              ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n                                          __               __\n                                   ____ _/ /_       ____ _/ /_\n                                  / __ `/ __/______/ __ `/ __/\n                                 / /_/ / /_ /_____/ /_/ / /_\n                                 \\__,_/\\__/       \\__,_/\\__/\n\n\n\n### at-at\n\n\u003c!-- badges --\u003e\n[![cljdoc badge](https://cljdoc.org/badge/overtone/at-at)](https://cljdoc.org/d/overtone/at-at) [![Clojars Project](https://img.shields.io/clojars/v/overtone/at-at.svg)](https://clojars.org/overtone/at-at)\n\u003c!-- /badges --\u003e\n\nSimple ahead-of-time function scheduler. Allows you to schedule the execution of an anonymous function for a point in the future.\n\n\u003c!-- installation --\u003e\n## Installation\n\nTo use the latest release, add the following to your `deps.edn` ([Clojure CLI](https://clojure.org/guides/deps_and_cli))\n\n```\novertone/at-at {:mvn/version \"1.4.65\"}\n```\n\nor add the following to your `project.clj` ([Leiningen](https://leiningen.org/))\n\n```\n[overtone/at-at \"1.4.65\"]\n```\n\u003c!-- /installation --\u003e\n\n### Basic Usage\n\nFirst pull in the lib:\n\n```clj\n(require '[overtone.at-at :as at])\n```\n\n`at-at` uses `ScheduledThreadPoolExecutor`s behind the scenes which use a thread pool to run the scheduled tasks. You therefore need create a pool before you can get going:\n\n```clj\n(def my-pool (at/mk-pool))\n```\n\nIt is possible to pass in extra options `:cpu-count`, `:stop-delayed?` and `:stop-periodic?` to further configure your pool. See `mk-pool`'s docstring for further info.\n\nNext, schedule the function of your dreams. Here we schedule the function to execute in 1000 ms from now (i.e. 1 second):\n\n```clj\n(at/at (+ 1000 (at/now)) #(println \"hello from the past!\") my-pool)\n```\n\nYou may also specify a description for the scheduled task with the optional `:desc` key.\n\nAnother way of achieving the same result is to use `after` which takes a delaty time in ms from now:\n\n```clj\n(at/after 1000 #(println \"hello from the past!\") my-pool)\n```\n\nYou can also schedule functions to occur periodically. Here we schedule the function to execute every second:\n\n```clj\n(at/every 1000 #(println \"I am cool!\") my-pool)\n```\n\nThis returns a scheduled-fn which may easily be stopped `stop`:\n\n```clj\n(at/stop *1)\n```\n\nOr more forcefully killed with `kill`.\n\nIt's also possible to start a periodic repeating fn with an initial delay:\n\n```clj\n(at/every 1000 #(println \"I am cool!\") my-pool :initial-delay 2000)\n```\n\nFinally, you can also schedule tasks for a fixed delay (vs a rate):\n\n```clj\n(at/interspaced 1000 #(println \"I am cool!\") my-pool)\n```\n\nThis means that it will wait 1000 ms after the task is completed before \nstarting the next one.\n\n### Resetting a pool.\n\nWhen necessary it's possible to stop and reset a given pool:\n\n```clj\n(at/stop-and-reset-pool! my-pool)\n```\n\nYou may forcefully reset the pool using the `:kill` strategy:\n\n```clj\n(at/stop-and-reset-pool! my-pool :strategy :kill)\n```\n\n### Viewing running scheduled tasks.\n\n`at-at` keeps an eye on all the tasks you've scheduled. You can get a set of the current jobs (both scheduled and recurring) using `scheduled-jobs` and you can pretty-print a list of these job using `show-schedule`. The ids shown in the output of `show-schedule` are also accepted in `kill` and `stop`, provided you also specify the associated pool. See the `kill` and `stop` docstrings for more information.\n\n```clj\n(def tp (at/mk-pool))\n(at/after 10000 #(println \"hello\") tp :desc \"Hello printer\")\n(at/every 5000 #(println \"I am still alive!\") tp :desc \"Alive task\")\n(at/show-schedule tp)\n;; [6][RECUR] created: Thu 12:03:35s, period: 5000ms,  desc: \"Alive task\"\n;; [5][SCHED] created: Thu 12:03:32s, starts at: Thu 12:03:42s, desc: \"Hello printer\"\n```\n\n### History\n\nat-at was extracted from the awesome music making wonder that is Overtone (http://github.com/overtone/overtone)\n\n### Release Tooling\n\nThis project uses the Lambda Island release tooling. See `bin/proj --help` for options. To release a new version to Clojars:\n\n```\nbin/proj release\n```\n\n### Authors\n\n* Sam Aaron\n* Jeff Rose\n* Michael Neale\n* Alexander Oloo\n* Arne Brasseur\n* Daniel MacDougall \n* Josh Comer\n\n(Ascii art borrowed from http://www.sanitarium.net/jokes/getjoke.cgi?132)\n\n\u003c!-- license --\u003e\n## License\n\nCopyright \u0026copy; 2011-2023 Sam Aaron, Jeff Rose, and contributors\n\nAvailable under the terms of the Eclipse Public License 1.0, see LICENSE.txt\n\u003c!-- /license --\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fovertone%2Fat-at","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fovertone%2Fat-at","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fovertone%2Fat-at/lists"}