PHPackages                             phasync/file-streamwrapper - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. phasync/file-streamwrapper

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

phasync/file-streamwrapper
==========================

Makes file IO asynchronous in phasync coroutines.

1.0.0-rc1(2y ago)511[1 issues](https://github.com/phasync/file-streamwrapper/issues)MITPHP

Since May 18Pushed 1y ago1 watchersCompare

[ Source](https://github.com/phasync/file-streamwrapper)[ Packagist](https://packagist.org/packages/phasync/file-streamwrapper)[ RSS](/packages/phasync-file-streamwrapper/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (1)Versions (3)Used By (0)

phasync/file-streamwrapper
==========================

[](#phasyncfile-streamwrapper)

`phasync/file-streamwrapper` is a PHP package that makes all disk IO operations asynchronous transparently, when used within a phasync coroutine. This package allows you to perform file operations like reading and writing files asynchronously, improving the efficiency of your I/O-bound tasks.

Installation
------------

[](#installation)

You can install the package via Composer. There is configuration needed as it automatically configures itself to be enabled inside coroutines and disables itself outside of coroutines.

```
composer require phasync/file-streamwrapper
```

Usage
-----

[](#usage)

When installing this package, async file:// IO is automatically enabled inside phasync coroutines. It does not interfere with IO outside of coroutines.

Example
-------

[](#example)

Here's an example of how to use phasync/file-streamwrapper within the phasync coroutine framework:

```
