Skip to content

Simple interface to running child processes in Ponylang 🐴 👶 ⚙️

Notifications You must be signed in to change notification settings

mfelsche/pony-procs

Repository files navigation

Procs

A simple interface to running child processes in Ponylang:

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 or a ProcessMonitor and accumulate chunks received from stdout, while all you want is to get stdout as String. Just run your process and handle the Promise containing either the ProcessResult with exit_code, stdout and stderr or an instance of ProcessError.

It is possible to pass environment variables and write something to stdin of the child process.

Status

CircleCI Build status Build Status

Installation

{ 
  "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

About

Simple interface to running child processes in Ponylang 🐴 👶 ⚙️

Resources

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published