Home
Docs
GitHub
Pricing
Blog
Log In

Run Sandworm Audit for your App

Get started
Hold on, we're currently generating a fresh version of this report
Generated on Apr 9, 2024 via composer

amphp/byte-stream v1.7.3

A stream abstraction to make working with non-blocking I/O simple.
Package summary
Share
0
issues
1
license
2
MIT
Package created
24 Apr 2017
Version published
4 Apr 2020
Maintainers
3
Total deps
2
Direct deps
1
License
MIT

Issues

0
This package has no issues

Licenses

MIT License

Permissive
OSI Approved
This is a human-readable summary of (and not a substitute for) the license. Disclaimer.
Can
commercial-use
modify
distribute
sublicense
private-use
Cannot
hold-liable
Must
include-copyright
include-license
2 Packages, Including:
amphp/amp@v2.6.4
amphp/byte-stream@v1.7.3
Disclaimer

This deed highlights only some of the key features and terms of the actual license. It is not a license and has no legal value. You should carefully review all of the terms and conditions of the actual license before using the licensed material.

Sandworm is not a law firm and does not provide legal services. Distributing, displaying, or linking to this deed or the license that it summarizes does not create a lawyer-client or any other relationship.

Direct Dependencies

1
All Dependencies CSV
β“˜ This is a list of amphp/byte-stream 's direct dependencies. Data on all dependencies, including transitive ones, is available via CSV download.
NameVersionSizeLicenseTypeVulnerabilities
amphp/ampv2.6.4-MIT
prod

Visualizations

Frequently Asked Questions

What does amphp/byte-stream do?

The amphp/byte-stream is an event-driven library designed with PHP concurrency and the fiber feature in mind, used for simplifying work with non-blocking I/O operations. The package specifically provides a stream abstraction, allowing an easy interface to work with multiple byte streams.

How do you use amphp/byte-stream?

The amphp/byte-stream can be utilized by installing it as a Composer dependency. After installation, the package offers two fundamental interfaces: ReadableStream and WritableStream which are abstractions over ordered sequences of bytes.

For example, if you want to use a ReadableStream, you can consume it as below:

$stream = ...;  // the stream to be consumed
$buffer = "";

while (($chunk = $stream->read()) !== null) {
    $buffer .= $chunk;
}

// use the $buffer variable for whatever you want

And when you want to use a WritableStream:

$readableStream = ...;  // the stream to be read from
$writableStream = ...;  // the stream to write to
$buffer = "";

while (($chunk = $readableStream->read()) !== null) {
    $writableStream->write($chunk);
}

$writableStream->end();

This package offers some basic implementations, and you can also find more in other libraries like amphp/socket.

Where are the amphp/byte-stream docs?

For detailed documentation and additional examples, users can refer to the readme content on the GitHub repository available at https://github.com/amphp/byte-stream.git. For specific examples on different implementations and usages, users can refer to the "./examples" directory present in the package's GitHub repository. It's also important to note that amphp/byte-stream follows the semver semantic versioning specification just like all other amphp packages.