Giter VIP home page Giter VIP logo

plumber's Introduction

plumber

使用workerman消费队列数据

Installation

You can add this library as a local, per-project dependency to your project using Composer:

composer require plumber/plumber

Use

$queuename = "queuename";
$callback = "test::test"; //消费sqs数据会会交由该方法处理
$config = []; //配置信息
$plumber = new plumber($queuename, $callback, $config);
$plumber->run();

config配置信息说明

  • provider - 队列产品, 如SQS, RabbitMQ
  • count - workerman所起的进程数量
  • rabbitmq - rabbitmq credentials 集合
    • host - 链接地址
    • port - 端口
    • login - 用户名
    • password - 密码
    • vhost - vhost地址默认为"/"
  • key - aws account id
  • secret - aws account secret
  • region - region

callback函数返回数据格式

["msg" => "success"]

注意: 只要当msg为successs时, 程序才会从队列中移除已经处理的消息

run

Usage: php yourfile <command> [mode]
Commands: 
start           Start worker in DEBUG mode.
                Use mode -d to start in DAEMON mode.
stop            Stop worker.
                Use mode -g to stop gracefully.
restart         Restart workers.
                Use mode -d to start in DAEMON mode.
                Use mode -g to stop gracefully.
reload          Reload codes.
                Use mode -g to reload gracefully.
status          Get worker status.
                Use mode -d to show live status.
connections     Get worker connections.

plumber's People

Contributors

kumu-nicolas avatar nicolaslh avatar

Watchers

 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.