pda/pheanstalk
Pheanstalk is a fully typed PHP 8.1+ client for beanstalkd 1.12+ work queues. Produce and consume jobs with clean APIs for tubes, reserve/put, touch, delete, release, and delays/timeouts—rewritten for strong static analysis.
By default classes are final, properties are private. From an API perspective, classes are internal by default.
Command classes encapsulate a single command from the beanstalk protocol. A command instance has 2 responsibilities:
Note that we say interpret here, parsing the response is already done.
Commands interpret CommandInterface. Since many commands have a subject that is either a tube name or a job ID, there
are abstract base classes TubeCommand and JobCommand that simplify command generation.
Typically different parts of a PHP application will use different parts of the beanstalkd protocol. In v5 we have split up the commands into three separate roles:
We still offer the Pheanstalk class that implements all interfaces, if possible however, it is recommend to inject the
most specific class for the situation. A PheanstalkPublisher class immediately makes it clear that all downstream code
just cares about pushing jobs to the queue.
This role contains functions that are used to gather information about the server and its jobs. The assumption is that this will be used mostly in management / reporting interfaces.
A job is created and pushed to the server, usually this happens within the request lifecycle. This role contains functions that allow for publishing jobs.
This role contains functions for listening to tubes and reserving / managing the jobs in them.
How can I help you explore Laravel packages today?