sgolemon/async-process

Asynchronous execution wrappers.

Installs: 1

Dependents: 0

Suggesters: 0

Security: 0

Stars: 1

Watchers: 0

Forks: 0

Open Issues: 0

Language:Hack

pkg:composer/sgolemon/async-process

dev-master 2016-05-26 19:54 UTC

This package is not auto-updated.

Last update: 2025-09-27 23:36:54 UTC


README

===== Awaitable Process

Basic Usage:

use sgolemon\Async;
use HH\Asio;

async function swapCase(string $str): Awaitable<?string> {
  $proc = new Async\Process('tr', 'a-zA-Z', 'A-Za-z');
  await $proc->run();

  // Will yield control to other awaitables if writing requires blocking
  await $proc->writeStdin($str);
  $proc->closeStdin();

  // Yield control while reading off result of command execution.
  return await $proc->drainStdout();
}

$hELLO = Asio\join(swapCase("Hello"));