Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/rksm/subprocess
Clojure lib for spawning subprocesses and listen to stdout and stderr via core.async
https://github.com/rksm/subprocess
Last synced: 3 months ago
JSON representation
Clojure lib for spawning subprocesses and listen to stdout and stderr via core.async
- Host: GitHub
- URL: https://github.com/rksm/subprocess
- Owner: rksm
- License: epl-1.0
- Created: 2014-08-12T00:46:55.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2015-08-06T17:23:49.000Z (over 9 years ago)
- Last Synced: 2024-06-17T00:01:46.511Z (7 months ago)
- Language: Clojure
- Size: 148 KB
- Stars: 4
- Watchers: 3
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# subprocess
Small wrapper around Java processes. Starts a process and returns an atom map that provides access to the process object, it's exit state and core.async channels for stdout and stderr.
The main purpose of this lib is it to provide easy access to the output streams of a process, without having to think about pumping threads and such.
## Usage
Start and forget:
```clojure
(async-proc "echo" "123")
```Listen on out with core.async:
```clojure
(let [proc (async-proc "bash" "-c" "echo 1; sleep .3; echo 2; sleep .3; echo 3")]
(future
(while (not (:exited? @proc))
(println "Got output" (async/