2017 © Pedro Peláez
 

library stream

Async Stream for RxPHP

image

rx/stream

Async Stream for RxPHP

  • Wednesday, April 18, 2018
  • by davidwdan
  • Repository
  • 3 Watchers
  • 3 Stars
  • 965 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 2 Forks
  • 0 Open issues
  • 11 Versions
  • 11 % Grown

The README.md

Stream Component

Provides RxPHP Observables for PHP streams, (*1)

This library is a wrapper around the ReactPHP stream library. It uses the Voryx event-loop which behaves like the Javascript event-loop. ie. You don't need to start it., (*2)

Usage

From File


$source = new \Rx\React\FromFileObservable("example.csv"); $source ->cut() //Cut the stream by PHP_EOL ->map('str_getcsv') //Convert csv row to an array ->map(function (array $row) { //Strip numbers from the first field $row[0] = preg_replace('/\d+/u', '', $row[0]); return $row; }) ->subscribe( function ($data) { echo $data[0] . "\n"; }, function ($e) { echo "error\n"; }, function () { echo "done\n"; } );

Read and Write to File


$source = new \Rx\React\FromFileObservable("source.txt"); $dest = new \Rx\React\ToFileObserver("dest.txt"); $source ->cut() ->filter(function ($row) { return strpos($row, 'foo'); }) ->map(function ($row) { return $row . 'bar'; }) ->subscribe($dest);

Stream - echo example


$read = new \Rx\React\StreamSubject(STDIN); $read ->takeWhile(function ($x) { return trim($x) != 15; }) ->subscribe(new \Rx\React\StreamSubject(STDOUT));

The Versions

18/04 2018

dev-master

9999999-dev

Async Stream for RxPHP

  Sources   Download

MIT

The Requires

 

The Development Requires

by Matt Bonneau
by David Dan

stream react reactphp rxphp reactivex rx.php

18/04 2018

3.0.1

3.0.1.0

Async Stream for RxPHP

  Sources   Download

MIT

The Requires

 

The Development Requires

by Matt Bonneau
by David Dan

stream react reactphp rxphp reactivex rx.php

19/12 2017

3.0.0

3.0.0.0

Async Stream for RxPHP

  Sources   Download

MIT

The Requires

 

The Development Requires

by Matt Bonneau
by David Dan

stream react reactphp rxphp reactivex rx.php

03/08 2017

2.0.3

2.0.3.0

Async Stream for RxPHP

  Sources   Download

MIT

The Requires

 

The Development Requires

by Matt Bonneau
by David Dan

stream react reactphp rxphp reactivex rx.php

21/03 2017

2.0.2

2.0.2.0

Async Stream for RxPHP

  Sources   Download

MIT

The Requires

 

by Matt Bonneau
by David Dan

stream react reactphp rxphp reactivex rx.php

21/03 2017

2.0.x-dev

2.0.9999999.9999999-dev

Async Stream for RxPHP

  Sources   Download

MIT

The Requires

 

by Matt Bonneau
by David Dan

stream react reactphp rxphp reactivex rx.php

14/03 2017

2.0.1

2.0.1.0

Async Stream for RxPHP

  Sources   Download

MIT

The Requires

 

by Matt Bonneau
by David Dan

stream react reactphp rxphp reactivex rx.php

05/01 2017

2.0.0

2.0.0.0

Async Stream for RxPHP

  Sources   Download

MIT

The Requires

 

by Matt Bonneau
by David Dan

stream react reactphp rxphp reactivex rx.php

29/02 2016

0.2.1

0.2.1.0

Async Stream for RxPHP

  Sources   Download

MIT

The Requires

 

by Matt Bonneau
by David Dan

stream react reactphp rxphp reactivex rx.php

24/01 2016

0.2.0

0.2.0.0

Async Stream for RxPHP

  Sources   Download

MIT

The Requires

 

by Matt Bonneau
by David Dan

stream react reactphp rxphp reactivex rx.php

23/01 2016

0.1.0

0.1.0.0

Async Stream for RxPHP

  Sources   Download

MIT

The Requires

 

by Matt Bonneau
by David Dan

stream react reactphp rxphp reactivex rx.php