Code Monkey home page Code Monkey logo

storee-workerproxy's Introduction

Light-weight worker proxy for work queues

Long running tasks directly on a underlying (PHP) system can be quite daunting and challenging to say the least, one often has to deal with way too many circumstances in subsystems that aren't really expected to be long-running.

This simple proxy can be setup through supervisord for example to watch the beanstalkd tubes in order to pass the payload to an endpoint in your main system.

We use this in Store-E for over 200 concurrent processes.

Usage

php /pathtothisworker/app/console.php worker:watch-tube tube_to_watch 'php /pathtomysystem/console some:command:run ... %%payload%%'

We use base64 encoded JSON data for payloads, keep in mind that you'll need additional escaping without encoding the data. Feel free to use our fork for base64 decoding support in beanstalk_console.

https://github.com/BureauPieper/beanstalk_console

As of now output and calls is written to app/logs. It's recommended to setup real log channels in your main system.

Supervisord example

[program:some_command]
command=php /pathtothisworker/app/console.php worker:watch-tube tube_to_watch 'php /pathtomysystem/console some:command:run %%payload%%'
autostart=true
autorestart=true
stderr_logfile=/pathtothisworker/app/logs/%(program_name)s.err.log
stdout_logfile=/pathtothisworker/app/logs/%(program_name)s.log
process_name=%(program_name)s_%(process_num)02d
numprocs=20
stdout_logfile_maxbytes=1MB
stderr_logfile_maxbytes=1MB

storee-workerproxy's People

Contributors

appeltaert avatar

Watchers

James Cloos avatar  avatar Pieter Stouten avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.