Amphp Cluster Versions Save

Building multi-core network applications with PHP.

v2.0.0-beta.1

4 months ago

Initial release compatible with AMPHP v3.

As with other libraries compatible with AMPHP v3, most cases of parameters or returns of Promise<ResolutionType> 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.

v1.0.1

2 years ago

Update to use amphp/file v2.x.

v1.0.0

4 years ago
  • Initial stable release
  • Added --name and --pid-file command line options compared v1.0.0-RC1

v1.0.0-rc1

4 years ago

Initial release candidate.

Note: This is a pre-release, there might be breaking changes in the final stable version.