{"id":19204677,"url":"https://github.com/walmartlabs/active-status","last_synced_at":"2025-08-20T02:32:09.520Z","repository":{"id":62435134,"uuid":"50459200","full_name":"walmartlabs/active-status","owner":"walmartlabs","description":"Present status of mulitple 'jobs' in a command line tool, using terminal capability codes","archived":false,"fork":false,"pushed_at":"2018-12-05T21:38:32.000Z","size":4200,"stargazers_count":119,"open_issues_count":2,"forks_count":8,"subscribers_count":30,"default_branch":"master","last_synced_at":"2025-08-12T08:24:25.433Z","etag":null,"topics":["async","clojure"],"latest_commit_sha":null,"homepage":"","language":"Clojure","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/walmartlabs.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-01-26T21:06:14.000Z","updated_at":"2024-05-31T07:46:00.000Z","dependencies_parsed_at":"2022-11-01T21:00:53.525Z","dependency_job_id":null,"html_url":"https://github.com/walmartlabs/active-status","commit_stats":null,"previous_names":[],"tags_count":15,"template":false,"template_full_name":null,"purl":"pkg:github/walmartlabs/active-status","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/walmartlabs%2Factive-status","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/walmartlabs%2Factive-status/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/walmartlabs%2Factive-status/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/walmartlabs%2Factive-status/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/walmartlabs","download_url":"https://codeload.github.com/walmartlabs/active-status/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/walmartlabs%2Factive-status/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":271254599,"owners_count":24727368,"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","status":"online","status_checked_at":"2025-08-20T02:00:09.606Z","response_time":69,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["async","clojure"],"created_at":"2024-11-09T13:09:23.753Z","updated_at":"2025-08-20T02:32:09.182Z","avatar_url":"https://github.com/walmartlabs.png","language":"Clojure","funding_links":[],"categories":[],"sub_categories":[],"readme":"## walmartlabs/active-status\n\n[![Clojars Project](http://clojars.org/walmartlabs/active-status/latest-version.svg)](http://clojars.org/walmartlabs/active-status)\n\nAn update-in-place status board for asynchronous processes inside your Clojure command line application.\n\nYou write in Clojure and use [core.async](https://github.com/clojure/core.async).  \nTraditional logging is fine for traditional servers, but what if you are writing a command line application?\nAnd what if that application is doing things asynchronously?  What kind of output do you want?\n\nThat's what active-status is for; it provides a status board ... console output that updates in-place.\nA simple way to let asynchronous jobs report their status and progress.\n\n![batman demo](images/active-progress-batman-demo.gif)\n\nHere's a more realistic example, from [db-migrate-example](https://github.com/hlship/db-migrate-example):\n\n![database migration demo](images/db-migrate.gif)\n\n### API Documentation\n\n[API Documentation](http://walmartlabs.github.io/apidocs/active-status/)\n\n### Example Code\n\n```clojure\n(require '[com.walmartlabs.active-status :as as]\n         '[clojure.core.async :refer [close! \u003e!!]])\n\n(defn process-files [board-ch files]\n  (let [job-ch (as/add-job board-ch)]\n      (\u003e!! job-ch (as/start-progress (count files)))\n      (doseq [f files]\n        (\u003e!! job-ch (str \"Processing: \" f))\n        (process-single-file f)\n        (\u003e!! job-ch (as/progress-tick)))\n      (close! job-ch)))\n      \n (def board-ch (as/console-status-board))\n             \n (process-files board-ch (file-seq \"process-dir\"))                   \n```\n\nOf course, this is a simple example. You are more likely to have multiple jobs running at any one time,\nof different types, implemented as core.async go blocks, rather than traditional single-threaded code\nin this example.\n\n\n### Limitations\n\n\n#### tput\n\nUnder the covers, active-status makes use of the [`tput`](https://en.wikipedia.org/wiki/Tput) command line tool.\nThis provides the terminal capabilities (special strings) that allow for moving the cursor around the\nscreen. It also expects that your console respects standard ANSI codes for formatting (bold and colored\ntext).\n\nThis largely eliminates the use of the library on Windows platforms.\n\nIn addition, the library uses italic font for completed jobs ... but even on OS X, Terminal.app\ndoes not support italics out of the box; this [post](https://alexpearce.me/2014/05/italics-in-iterm2-vim-tmux/)\nexplains how to setup italics. \n\n[iTerm2](https://iterm2.com/) version 3 does support italics.\nIt's free and awesome, you should be using this.\n\n#### Terminal width\n\nThe library currently doesn't know about the width of the terminal; it will output any job summary text provided, and\nmay inadvertently wrap the output.\n\n#### Other output\n \nThe library has no way of determining if some other part of the application is writing to `*out*` or `*err*`.\nAny such output will either move the cursor or scroll the screen; the library uses relative cursor motion\nwhen updating a job's line in the status board,\nso either of these cases will cause job output to be printed on the wrong lines (lower than expected). \nThis is compounded by the fact that job lines are only updated when the underlying data is changed (by sending an \nupdate to the job's channel).\n\nStarting in 0.1.8, the `with-output-redirected` macro can usually, but not always, prevent unwanted output from\ninterfering with the status board.\n\n**TL;DR**: Don't write any output while the status board is running.\n\n### Compatibility\n\nIt currently renders quite well in [iTerm](https://www.iterm2.com/).\n\nIn Terminal.app, the default terminfo is 'ansi'; the library works correctly only if this is changed to 'xterm' (or some variant).\n\nIntelliJ Terminal (IntelliJ 15, OS X) seems to work fine.\n\nCursive REPL (Intellij 15, OS X) is currently quite broken, alas.\nBut, then again, REPL oriented development and the\nstatus tracker are not a good mix (see the \"other output\" section above).\n\n### Component\n\nThe namespace `com.walmartlabs.active-status.component` defines a component that may be used\nwithin a overall component system, which uses configuration to decide whether\nto instantiate the console status board, or the minimal status board.\n \nSee [com.stuartsierra/component](https://github.com/stuartsierra/component) \nand [Schematic](https://github.com/walmartlabs/schematic).\n\n### Execution\n\nactive-status is intended for long running jobs.\nTypically, the deployment model is an Uberjar.\nFor best execution, use `nohup` and redirect input and output:\n\n    java -jar xxx-standalone.jar ... \u003e console.out 2\u003e console.err \u003c /dev/null \u0026 tail -f console.out\n    \nThis will start the application running, and it will continue to completion,\neven after a logout.\nOutput is sent to a file, which can be `tail`ed to see current status.\n\n\n### Future Directions\n\nMore options than the console score board are expected; these might include a pop-up Swing frame, or\na client/server approach (with a server acting as the score board, and providing a web user interface).\n\nA ClojureScript variant, especially one that could work in Node, would be valuable.\n\n----\n\nwalmartlabs/active-status is released under the terms of the Apache Software License 2.0.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwalmartlabs%2Factive-status","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwalmartlabs%2Factive-status","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwalmartlabs%2Factive-status/lists"}