reactphp/react — pull request #97 by igorw (2012-11-17 02:14:29+00:00)
Title: Add ThroughStream and ReadableStream primitives

These are basic building blocks for building custom streams upon. The
ThroughStream is essentially a filter which allows you to change the value
or perform a passive action (like logging) by overriding the filter()
method.

Example:

class FooStream extends ThroughStream
{
public function filter($data)
{
return foo.$data;
}
}

This useful example prepends the string "foo" to any data it receives.