Download the PHP package ryunosuke/hellowo without Composer
On this page you can find all versions of the php package ryunosuke/hellowo. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package hellowo
hellowo
Description
This package is simple job worker.
Install
This requires pcntl
extension. Also, Windows only works minimally.
Feature
Driver
Driver features:
feature | FileSystem | Gearman | Beanstalk | MySql | PostgreSql | RabbitMQ |
---|---|---|---|---|---|---|
simply | very high | high | high | middle | middle | low |
pull or push(*1) | pull(&inotify) | push | push | pull(&trigger) | pull(&pub/sub) | push |
multi worker server | optional(*2) | yes | yes | yes | yes | yes |
not lost to sudden death(*3) | yes (ttr) | no | yes (ttr) | yes (kill) | yes (keepalive) | yes (heartbeat) |
priority job | yes | yes | yes | yes | yes | yes |
delay job | yes | no | yes | yes | yes | optional(*4) |
managed retry | no | no | no | no | no | yes |
unmanaged retry limit | yes | no | no | yes | yes | no |
clustering | no | no | no | optional(*5) | optional(*5) | yes |
- *1 push is almost real-time, but pull has time lag due to polling
- *2 e.g. NFS
- *3 Except for FileSystem, TCP keepalive can be enabled to some extent
- *4 e.g. rabbitmq-delayed-message-exchange, Deadletter exchange
- *5 e.g. Replication, Fabric, NDB
Worker
The recommended process manager is systemd. Also, the basic operation is in series. If you want to run multiple jobs in parallel, you need to launch multiple processes.
SIGALRM is used to implement the timeout, so it cannot be used by the user. When it receives an SIGTERM or SIGINT, it waits for the currently running job until stopping it. Therefore, in some cases, it may take a long time to stop (see TimeoutStopSec of systemd).
Default logging, operation log is written to STDOUT. php error log is written to STDERR.
Operation log can be changed by overriding the logger
option.
php error log uses system default. This can be changed by php.ini or ini_set.
Client
Client is a simple class from which only the request part of the driver is extracted. You can use any client to send jobs without using this class.
- e.g. filesystem:
touch /path/to/job.txt
- e.g. mysql:
INSERT INTO jobs(message) VALUES("foo")
Demo
- Driver: mysql
- Parallel: 4
- Log: /var/log/hellowo
require root.
ready
ready worker
ready systemd
send data
output log
License
MIT
Release
Versioning is romantic versioning(no semantic versioning).
- major: large BC break. e.g. change architecture, package, class etc
- minor: small BC break. e.g. change arguments, return type etc
- patch: no BC break. e.g. fix bug, add optional arguments, code format etc
1.1.5
- [feature] PostgreSqlDriver
- [fixbug] 初回実行時に setup されない不具合
- [fixbug] 一部のドライバーにミリ秒を与えるとエラーになる
- [fixbug] heartbeat 秒応答がないホストに対して heartbeat 秒 ping を待機している
- [feature] delay がある場合は notify しても無駄
- [feature] MySql のミリ秒対応
1.1.4
- [fixbug] USR1 以外でも async をキャンセルしていた
- [fixbug] select と sleep で使用されるインデックスが異なる可能性がある
1.1.3
- [feature] JSON を組み込みで実装
- [refactor] API の整理
- [refactor] ext のパスを変更
- [refactor] Listener の階層を Logger と合わせる
1.1.2
- [feature] リトライ回数を実装
- [fixbug] standby 状態で setup して死ぬ不具合を修正
1.1.1
- [feature] added restart trigger
1.1.0
- [*change] select+done+retry -> generator
- [change] log format
- [fixbug] no keeps connecting on server gone away
1.0.1
- [feature] check writable mode
- [fixbug] transaction may not be closed
- [fixbug] fix miss (PROCEDURE -> FUNCTION)
1.0.0
- [feature] added logger logs when Throwable
- [refactor] changed nullable to notnull
0.2.0
- [fixbug] fixed "Commands out of sync" when receive USR1
- [fixbug] deleted IF EXISTS from mysql driver
- [feature] added listen cycle event
0.1.0
- [change] move notify to notifyLocal
0.0.0
- publish