{"id":19345239,"url":"https://github.com/zlikavac32/beanstalkd-lib-bundle","last_synced_at":"2026-05-17T02:10:47.116Z","repository":{"id":57091524,"uuid":"183317845","full_name":"zlikavac32/beanstalkd-lib-bundle","owner":"zlikavac32","description":"Bundle for zlikavac32/beanstalkd-lib","archived":false,"fork":false,"pushed_at":"2020-04-11T01:22:03.000Z","size":653,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-01-06T13:47:28.331Z","etag":null,"topics":["beanstalkd","job-queue","symfony","symfony-bundle","worker","worker-queue"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/zlikavac32.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-04-24T22:54:13.000Z","updated_at":"2020-04-11T01:21:24.000Z","dependencies_parsed_at":"2022-08-22T18:21:00.554Z","dependency_job_id":null,"html_url":"https://github.com/zlikavac32/beanstalkd-lib-bundle","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zlikavac32%2Fbeanstalkd-lib-bundle","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zlikavac32%2Fbeanstalkd-lib-bundle/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zlikavac32%2Fbeanstalkd-lib-bundle/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zlikavac32%2Fbeanstalkd-lib-bundle/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zlikavac32","download_url":"https://codeload.github.com/zlikavac32/beanstalkd-lib-bundle/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240451946,"owners_count":19803544,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["beanstalkd","job-queue","symfony","symfony-bundle","worker","worker-queue"],"created_at":"2024-11-10T04:05:52.764Z","updated_at":"2025-11-17T02:02:25.683Z","avatar_url":"https://github.com/zlikavac32.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Beanstalkd lib bundle\n\n[![Build Status](https://travis-ci.org/zlikavac32/beanstalkd-lib-bundle.svg?branch=master)](https://travis-ci.org/zlikavac32/beanstalkd-lib-bundle)\n\nBundle for [zlikavac32/beanstalkd-lib](https://github.com/zlikavac32/beanstalkd-lib)\n\n## Table of contents\n\n1. [Installation](#installation)\n1. [Configuration](#configuration)\n1. [Usage](#usage)\n    1. [Tube definition](#tube-definition)\n    1. [Runner definition](#runner-definition)\n    1. [Server controller](#server-controller)\n1. [Examples](#examples)\n\n## Installation\n\nRecommended installation is through Composer.\n\n```\ncomposer require zlikavac32/beanstalkd-lib-bundle\n```\n\nBundle must be enabled in `config/bundles.php`.\n\n```php\nreturn [\n    /* ... */\n\n    Zlikavac32\\BeanstalkdLibBundle\\BeanstalkdLibBundle::class =\u003e ['all' =\u003e true],\n\n    /* ... */\n]\n```\n\nNext add default configuration entry for `beanstalkd_lib`. For example, in `config/services/beanstalkd_lib.yaml`. Check [Configuration](#configuration) section for more info.\n\n```yaml\nbeanstalkd_lib: ~\n```\n\nThis library uses [zlikavac32/nsb-decorators](https://github.com/zlikavac32/nsb-decorators) which requires custom autoloader in application entry points like `bin/console`.\n\n```php\nuse Zlikavac32\\NSBDecorators\\Proxy;\n\n/* ... */\n\nspl_autoload_register(Proxy::class.'::loadFQN');\n```\n\nFor now, since proxied decorators are evaluated, container requires must not be inlined (`container.dumper.inline_class_loader` parameter must not exist or be set to `false`).\n\nAsync signals are also a requirement.\n\n```php\npcntl_async_signals(true);\n```\n\n## Configuration\n\nDefault configuration looks like:\n\n```yaml\nbeanstalkd_lib:\n    adapters:\n        socket: Zlikavac32\\BeanstalkdLib\\Adapter\\PHP\\Socket\\NativePHPSocket\n        yaml_parser: Zlikavac32\\BeanstalkdLib\\Adapter\\Symfony\\Yaml\\SymfonyYamlParser\n    server:\n        host: 127.0.0.1\n        port: 11300\n```\n\nCustom adapters can be implemented for better integration with existing software.\n\n## Usage\n\nThis section explains how to use this bundle.\n\n### Tube definition\n\nTo use beanstalkd lib client, every managed tube must be configured.\n\n```yaml\ntube.domain_tube: # keys value itself is not important to the bundle\n    class: Zlikavac32\\BeanstalkdLib\\Client\\TubeConfiguration\\StaticTubeConfiguration\n    arguments:\n        $defaultDelay: 0\n        $defaultPriority: 1024\n        $defaultTimeToRun: 60\n        $defaultTubePauseDelay: 86400\n        $serializer: '@DomainSerializer'\n    tags:\n        - { name: tube_configuration, tube: brute_force_hash }\n```\n\nTag `tube_configuration` collects tube configurations and links them with the client.\n\nOptionally, one could also use `linker` tag to link with the serializer, as can be seen in the [examples/full/container.yaml](examples/full/container.yaml).\n\n### Runner definition\n\nTo define tube runner, we can use `job_runner` tag. This tag collects runners and links them with the job dispatcher.\n\n```yaml\nFoo\\Runner\\SomeRunnerClass:\n    tags:\n        - { name: job_runner, tube: tube_for_this_runner }\n```\n\nAdditional decorators can be applied either manually or through `decorator` tag, as can be seen in the [examples/full/container.yaml](examples/full/container.yaml).\n\nTo run existing runners, use `bin/console worker:run`.\n\n### Server controller\n\nSimple REPL controller for the client is provided as `bin/console worker:controller`. It can be used also to run standalone commands.\n\n![Server controller demo](docs/res/img/server-controller.webp)\n\nFeatures include:\n\n- list tubes\n- pause/unpause tubes\n- print stats (with optional refresh)\n- flush tube/tubes\n\nTo use pager in `peek` command, evironment variable `PAGER` must be set to a pager program. `less` is one such program whcih can be used directly like `PAGER=less bin/console ...` or exported somewhere.\n\nFor `less`, additional environment variable `LESS` that describes `less` arguments can be defined. For example, `LESS='-F' PAGER=less bin/console` can be used to skip paging if the whole text can be displayed on screen.\n\nIn Docker, `-R` should be used to display color escape sequences correctly.\n\n## Examples\n\nYou can see more examples with code comments in [examples](/examples).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzlikavac32%2Fbeanstalkd-lib-bundle","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzlikavac32%2Fbeanstalkd-lib-bundle","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzlikavac32%2Fbeanstalkd-lib-bundle/lists"}