https://github.com/mfelsche/pony-procs
Simple interface to running child processes in Ponylang :horse: :baby: :gear:
https://github.com/mfelsche/pony-procs
Last synced: about 2 months ago
JSON representation
Simple interface to running child processes in Ponylang :horse: :baby: :gear:
- Host: GitHub
- URL: https://github.com/mfelsche/pony-procs
- Owner: mfelsche
- Created: 2019-03-17T21:01:47.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2019-03-17T21:03:11.000Z (about 6 years ago)
- Last Synced: 2025-01-20T04:18:40.776Z (3 months ago)
- Language: Pony
- Homepage:
- Size: 12.7 KB
- Stars: 5
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
# Procs
A simple interface to running child processes in [Ponylang](https://ponylang.io):
```pony
use "procs"actor Main
new create(env: Env) =>
try
let result_promise = Procs.run_env(env, ["/usr/bin/echo"; "how"; "awesome"; "is"; "this;"])?
result_promise.next[None]({(res) =>
match res
| let pres: ProcessResult =>
env.out.write(pres.stdout)
| let perr: ProcessError =>
env.err.print("Meh! :(")
end
})
end
```No need to create a [ProcessNotify](process-ProcessNotify.md) or a [ProcessMonitor](process-ProcessMonitor.md) and
accumulate chunks received from stdout, while all you want is to get stdout as `String`. Just run your process and
handle the [Promise](promises-Promise.md) containing either the [ProcessResult](procs-ProcessResult.md) with `exit_code`,
`stdout` and `stderr` or an instance of [ProcessError](process-ProcessError.md).It is possible to pass environment variables and write something to stdin of the child process.
## Status
[](https://circleci.com/gh/mfelsche/pony-procs) [](https://ci.appveyor.com/project/mfelsche/pony-procs/branch/master) [](https://travis-ci.org/mfelsche/pony-procs)
## Installation
* Install [pony-stable](https://github.com/ponylang/pony-stable)
* Update your `bundle.json````json
{
"type": "github",
"repo": "mfelsche/pony-procs"
}
```* `stable fetch` to fetch your dependencies
* `use "procs"` to include this package
* `stable env ponyc` to compile your application