Skip to content

sgolemon/async-process

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

===== 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"));

About

Hack library for executing external processes with async read/writes

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages