2017 © Pedro Peláez
 

library process

Long time execution script updates. Get stdout of long running script from another process!

image

kapitchi/process

Long time execution script updates. Get stdout of long running script from another process!

  • Sunday, July 7, 2013
  • by kapitchi
  • Repository
  • 1 Watchers
  • 3 Stars
  • 109 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 1 Forks
  • 1 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

Zend Framework 2 - Kapitchi Process module

Version: 0.1-dev
Author: Kapitchi Team
Website: http://kapitchi.com
Demo: http://kapitchi.com/showcase, (*1)

README.md status: INCOMPLETE, (*2)

Licence

LGPLv3
The GNU Lesser General Public License, version 3.0, (*3)

Introduction

Primary usage of this module is running long time operations "in background" and being able to receive progress updates., (*4)

Installation

TODO, (*5)

Basic Usage

  1. Register a process/job you want to run - you get a process ID / pid.
$process = $processor->registerJob(new \KapitchiProcess\Job\ShellJob('ping -n 30 kapitchi.com'));
$pid = $process->getId();
  1. Run a process using separate AJAX request as to get response will take as long as your process runs
$processor->run($pid);
  1. Use /process/api/bus-reader/read-next/[pid] (AJAX every 1sec?) to request process updates in JSON format as an example below.

stdoutDelta contains data written by the process to "stdOut" after the last progress request only., (*6)

{
    processId: "895472f28183dc67d39d9680d93c8e9a",
    isFinished: false,
    isStarted: true,
    startedTime: 1366660603,
    runningTime: 24,
    registry: [ ],
    stdoutDelta: "Reply from 176.74.179.134: bytes=32 time=415ms TTL=38 Reply from 176.74.179.134: bytes=32 time=416ms TTL=38 Reply from 176.74.179.134: bytes=32 time=415ms TTL=38 Reply from 176.74.179.134: bytes=32 time=416ms TTL=38 "
}

TODO, (*7)

The Versions

07/07 2013

dev-master

9999999-dev http://kapitchi.com

Long time execution script updates. Get stdout of long running script from another process!

  Sources   Download

LGPL-3.0

The Requires

  • php >=5.3.3

 

zf2 kapitchi