Skip to content

2.0.0

Compare
Choose a tag to compare
@trowski trowski released this 13 Dec 17:48
· 1 commit to 2.x since this release
v2.0.0
0b050b1

Initial stable release compatible with AMPHP v3 🎉 (after a much longer beta than intended 😊).

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

The tools available in this library have been expanded beyond that of version 1. A component to request server sockets from a parent process is now included as part of the public API, as well as a pair of components to transfer client sockets between processes.

New Features

  • Added ServerSocketPipeFactory and ServerSocketPipeProvider for requesting and providing server sockets to a child process from a parent process (Documentation).
  • Added ClientSocketReceivePipe and ClientSocketSendPipe for transferring client sockets and related data between processes (Documentation).

Changes

  • Cluster::getId() has been renamed to Cluster::getContextId(), returning the worker ID or null if not running as a cluster worker.
  • Cluster::listen() has been replaced with Cluster::getServerSocketFactory(), which returns an instance of Amp\Socket\SocketServerFactory that may be used to create a server or passed to components requiring an instance of that interface.
  • Cluster::onMessage() and Cluster::send() has been replaced with Cluster::getChannel(), returning an instance of Amp\Sync\Channel which may be used to send and receive messages from the cluster watcher.
  • Cluster::onTerminate() has been replaced with Cluster::awaitTermination() which awaits a signal from the cluster watch to stop.
  • Watcher has been renamed to ClusterWatcher.
  • Watcher::onMessage() has been replaced with ClusterWatcher::getMessageIterator(), returning a concurrent iterator of ClusterWorkerMessage objects.