Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Pheanstalk Laravel Package

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.

View on GitHub
Deep Wiki
Context7

This file is intended to roughly document design decisions

Class design

By default classes are final, properties are private. From an API perspective, classes are internal by default.

Commands

Command classes encapsulate a single command from the beanstalk protocol. A command instance has 2 responsibilities:

  • Formulate the protocol commandline
  • Interpret the result

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.

Roles: Manager, Publisher and Subscriber

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:

  • Manager
  • Publisher
  • Subscriber

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.

Manager

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.

Publisher

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.

Subscriber

This role contains functions for listening to tubes and reserving / managing the jobs in them.

Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
davejamesmiller/laravel-breadcrumbs
artisanry/parsedown
bower-asset/punycode
bower-asset/inputmask
bower-asset/jquery
bower-asset/yii2-pjax
laravel/nova
spatie/laravel-mailcoach
spatie/laravel-superseeder
laravel/liferaft
nst/json-test-suite
danielmiessler/sec-lists
jackalope/jackalope-transport
twbs/bootstrap4
php-http/client-implementation
phpcr/phpcr-implementation
cucumber/gherkin-monorepo
haydenpierce/class-finder
psr/simple-cache-implementation
uri-template/tests