Building multi-core network applications with PHP.
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.
ServerSocketPipeFactory
and ServerSocketPipeProvider
for requesting and providing server sockets to a child process from a parent process (Documentation).ClientSocketReceivePipe
and ClientSocketSendPipe
for transferring client sockets and related data between processes (Documentation).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.Update to use amphp/file
v2.x
.
--name
and --pid-file
command line options compared v1.0.0-RC1Initial release candidate.
Note: This is a pre-release, there might be breaking changes in the final stable version.