Releases: EdmondDantes/amphp-pool
Releases · EdmondDantes/amphp-pool
v1.0.2
[1.0.2] - 2024-11-19 [Release]
Changed
- Now,
WorkerLogHandler
adds additional metadata about the Worker to the log:workerId
,workerPid
,
worker type information, and additionalWorkerGroup
details.
Full Changelog: v1.0.1...v1.0.2
v1.0.1
Added WorkerPoolInterface::setPoolContext()
+ WorkerInterface::getPoolContext()
methods.
Each Worker
can receive a shared application context during startup,
which is set using the setPoolContext()
method before calling the WorkerPoolInterface::start()
method.
Full Changelog: v1.0.0...v1.0.1
AMPHP POOL v1.0.0
Here is the release of the AMPHP POOL library, designed for creating server applications with an infrastructure built entirely in PHP without additional dependencies.
Why is this needed?
- You want to use only pure PHP without additional extensions.
- You want to control how your Workers operate,
and you want to be able to program their behavior to ensure a better balance of performance and stability.
Features
- Workers for handling connections and background tasks (jobs), which are restarted and scaled on demand.
- Support for different
types
andgroups
of Workers with varying behaviors. - Strategies for
restarting
,scaling
, andpickuping
Workers for load distribution. - Execution of Jobs based on
priority
andweight
(weight being an estimate of resource consumption). Coroutine Scheduler
for distributing a load among long-running background jobs.- Support for telemetry and statistics with Prometheus + Grafana.
- Support for Windows.
AMPPHP Pool 0.9.5 RC
Release candidate with all core features and functions implemented.
Changelog
Fixed
- Fixed socket waiting when the server is about to shut down.
The issue remains forUNIX
and is caused by the architecture of theAMPHP
httpserver
. - Fixed the synchronization of
WorkerState
for the isReady status and fields related to the worker's termination state. - Fixed the bug with Server Socket hanging under
Windows
.
Added
- Added a component for monitoring the summary application state:
start time
,number of restarts
,uptime
. - Added a new strategy
AutoRestartByQuota
,
which allows you to restart the worker after a certain number of processed jobs or memory quota, etc.
Changed
- Refined the FLOW of error analysis for the running Worker process.
- Refactored the
WorkerProcessContext
flow. Coroutines for monitoring the process and the message queue
are separated by their own triggers, which ensure a clear order of execution.
The message loop coroutine finishes first, followed by the observer coroutine. - Added a method
Worker::awaitShutdown
, which ensures the orderly shutdown of the worker.
Now the worker sends aNULL
message, signaling the closure of the channel,
and then waits for confirmation from the parent process. Only after this does it terminate. - Added a new method
WorkerPool::restartWorker
, which allows you to restart the worker softly without stopping the entire pool. - Improved error handling from workers. Remote exceptions are properly accounted for and available for logging.
Preview version
Preview version with raw futures