Pipe streams and handle events