Skip to content
This repository has been archived by the owner on Oct 1, 2023. It is now read-only.

4.31.0: IO changes

Compare
Choose a tag to compare
@fredemmott fredemmott released this 11 Nov 21:28

This release:

  • adds TCP\connect_nd_async(), TCP\connect_async(), TCP\Server and equivalents in Unix\
  • refactors file locking:
    • removed the _NON_BLOCKING members of the LockType enum
    • splits lock() into lock() (blocking) and tryLockx() (non-blocking)
    • tryLockx() will throw an AlreadyLockedException if flock() fails with EWOULDBLOCK
  • refactors all other IO\ and File\ exceptions:
    • adds OS\Exception, containing an ErrorCode; ErrorCode contains constants used in C errno or h_error constants
    • removes per-operation exceptions except for locking, e.g. File\WriteException
    • adds convenience subclasses of OS\Exception for common cases, such as AlreadyExistsException
  • adds IO\SeekableHandle, extended by File\Handle
  • adds Debug\dump_async() as a replacement for \var_dump(): if IO\request_output() is used, STDOUT is made non-blocking, so can truncate
  • adds optional timeouts to readAsync(), readLineAsync(), and writeAsync()
  • contains several bugfixes