Skip to content

Commit

Permalink
Fix typo, missing hook-in
Browse files Browse the repository at this point in the history
  • Loading branch information
cursedcoder committed Apr 9, 2016
1 parent c1c1997 commit 7f3b81f
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 54 deletions.
10 changes: 7 additions & 3 deletions EProcess/Adapter/ChildProcess.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

use EProcess\Behaviour\UniversalSerializer;
use EProcess\MessengerFactory;

use EProcess\Stream\FullDrainStream;
use React\ChildProcess\Process;
use Symfony\Component\Process\PhpExecutableFinder;

Expand Down Expand Up @@ -69,8 +69,12 @@ public function create($class, array $data = [])

$this->process = new Process($php);
$this->process->start($this->loop, 0.1);

$this->process->stdin->resume();

$this->process->stdin = new FullDrainStream(
$this->process->stdin->stream,
$this->loop
);

$this->process->stdin->write($script);

$this->process->stdin->on('full-drain', function() {
Expand Down
51 changes: 0 additions & 51 deletions EProcess/Stream/FullDrainSteam.php

This file was deleted.

18 changes: 18 additions & 0 deletions EProcess/Stream/FullDrainStream.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?php

namespace EProcess\Stream;

use React\Stream\Stream;
use React\EventLoop\LoopInterface;

class FullDrainStream extends Stream
{
public function __construct($stream, LoopInterface $loop)
{
parent::__construct($stream, $loop);

$this->buffer->on('full-drain', function () {
$this->emit('full-drain', array($this));
});
}
}

0 comments on commit 7f3b81f

Please sign in to comment.