Skip to content

Releases: amphp/file

4.0.0

Choose a tag to compare

@trowski trowski released this 09 May 16:38
v4.0.0
6e122dd

Users of 3.x should be able to update to 4.x without code changes unless their application did one of the following:

  • Defined a custom File implementation
  • Initialized ParallelFilesystemDriver with a custom worker count.

Breaking Changes

This release adds a lock(), tryLock(), and unlock() to the File interface. These methods provide a non-blocking means of locking and unlocking a file.

  • File::lock(): Non-blocking method to obtain a shared or exclusive lock on the file. This method must only return once the lock has been obtained.
  • File::tryLock(): Makes a single non-blocking attempt to obtain a shared or exclusive lock on the file. Returns true if the lock was obtained, otherwise false.
  • File::unlock(): Unlocks the file if the lock is currently held.

In 3.x, the constructor of ParallelFilesystemDriver accepted an optional WorkerPool and a number of workers to use from that pool. In 4.x, instead the constructor now requires only an optional LimitedWorkerPool (a new pool is created if one is not provided). The number of workers used for opening files is determined by the value returned from LimitedWorkerPool::getWorkerLimit(). Use a DelegateWorkerPool if you wish to use an existing pool and limit the number of workers used from the pool to open files. In general, it is not necessary to customize the parallel filesystem driver.


Full Changelog: v3.2.0...v4.0.0

4.0.0 Beta 1

4.0.0 Beta 1 Pre-release
Pre-release

Choose a tag to compare

@trowski trowski released this 11 Jan 20:09
v4.0.0-beta.1
3c57ba9

Users of 3.x should be able to update to 4.x without code changes unless their application did one of the following:

  • Defined a custom File implementation
  • Initialized ParallelFilesystemDriver with a custom worker count.

Breaking Changes

This release adds a lock(), tryLock(), and unlock() to the File interface. These methods provide a non-blocking means of locking and unlocking a file.

  • File::lock(): Non-blocking method to obtain a shared or exclusive lock on the file. This method must only return once the lock has been obtained.
  • File::tryLock(): Makes a single non-blocking attempt to obtain a shared or exclusive lock on the file. Returns true if the lock was obtained, otherwise false.
  • File::unlock(): Unlocks the file if the lock is currently held.

In 3.x, the constructor of ParallelFilesystemDriver accepted an optional WorkerPool and a number of workers to use from that pool. In 4.x, instead the constructor now requires only an optional LimitedWorkerPool (a new pool is created if one is not provided). The number of workers used for opening files is determined by the value returned from LimitedWorkerPool::getWorkerLimit(). Use a DelegateWorkerPool if you wish to use an existing pool and limit the number of workers used from the pool to open files. In general, it is not necessary to customize the parallel filesystem driver.


Full Changelog: v3.2.0...v4.0.0-beta.1

3.2.0

Choose a tag to compare

@trowski trowski released this 10 Dec 05:19
v3.2.0
28b38a8

What's Changed

  • The parallel driver no longer reuses the global worker pool if a specific instance is not provided to the constructor. Instead, a new worker pool is created.
  • The $workerLimit parameter to the constructor of ParallelFilesystemDriver is now deprecated. Pass an instance of LimitedWorkerPool instead.

Full Changelog: v3.1.1...v3.2.0

3.1.1

Choose a tag to compare

@trowski trowski released this 16 Aug 15:13
v3.1.1
58c8efe

What's Changed

  • Dropped support for ext-uv < 0.3.0.
  • Changed the version check for ext-uv to avoid an ext-opcache bug (see amphp/http-client#365).

Full Changelog: v3.1.0...v3.1.1

3.1.0

Choose a tag to compare

@trowski trowski released this 21 Apr 15:10
v3.1.0
1d51235

What's Changed

  • Add FileCache class by @Nadyita in #83
  • Add KeyedFileMutex by @bwoebi in #62
  • Made implicit nullable types explicit to avoid deprecation notice in PHP 8.4

New Contributors

Full Changelog: v3.0.2...v3.1.0

3.0.2

Choose a tag to compare

@trowski trowski released this 27 Dec 22:56
v3.0.2
45d8d84

What's Changed

  • Fixed detecting if a file is writing from the file mode when r+ (or similar) is used as the mode. (#77)
  • Fixed assertion failing during shutdown destruction of ParallelFilesystemDriver. (#81)

Full Changelog: v3.0.1...v3.0.2

3.0.1

Choose a tag to compare

@kelunik kelunik released this 23 Jul 19:04
v3.0.1
efeb737

What's Changed

  • Fix touch() on non-existent files in ext-uv and ext-eio by @kelunik (#73)
  • Fix write() truncation with ext-uv and ext-eio by @danog in (#76)

Full Changelog: v3.0.0...v3.0.1

3.0.0

Choose a tag to compare

@kelunik kelunik released this 02 Mar 22:41
v3.0.0
1c9f0eb

Stable release compatible with AMPHP v3 and fibers! 🎉

As with other libraries compatible with AMPHP v3, most cases of parameters or returns of Promise<ResolutionType> have been replaced with ResolutionType.

  • Renamed BlockingDriver to BlockingFilesystemDriver
  • Renamed EioDriver to EioFilesystemDriver
  • Renamed ParallelDriver to ParallelFilesystemDriver
  • Renamed StatusCachingDriver to StatusCachingFilesystemDriver
  • Renamed UvDriver to UvFilesystemDriver
  • Renamed Amp\File\Sync\AsyncFileMutex to Amp\File\FileMutex
  • Added ?Cancellation as first parameter of File::read()
  • Added File::isSeekable()
  • Removed File::SEEK_SET, File::SEEK_CUR, and File::SEEK_END
  • Added Amp\File\Whence for seeking instead

3.0.0 Beta 6

3.0.0 Beta 6 Pre-release
Pre-release

Choose a tag to compare

@trowski trowski released this 08 Jan 18:25
v3.0.0-beta.6
bac8157
  • Fixed compatibility with v2.0 of amphp/byte-stream by updating File implementations to also implement Traversable.

3.0.0 Beta 5

3.0.0 Beta 5 Pre-release
Pre-release

Choose a tag to compare

@trowski trowski released this 18 Nov 18:52
v3.0.0-beta.5
d68ac6d
  • Fixed PendingOperationError being thrown after several seek-then-write operations in UvFile and EioFile.