承接 mf4php/mf4php-beanstalk 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

mf4php/mf4php-beanstalk

最新稳定版本:1.1.3

Composer 安装命令:

composer require mf4php/mf4php-beanstalk

包简介

This is an mf4php binding for Beanstalk.

README 文档

README

This is a Beanstalk binding for mf4php

Attention

You have to create your own long running script to reserve messages from beanstalk and forward jobs to the dispatcher.

The reason why it is not implemented in the dispatcher is it should watch several queues, which is impossible in one process. Another reason is that it is often necessary to create a lightweight long running script without any open resources (database, etc.), and it executes a CLI program to pass the message to the dispatcher.

Configuration

<?php
$dispatcher = new BeanstalkMessageDispatcher($pheanstalk);
$queue = new DefaultQueue('queue');

/* @var $listener MessageListener */
$dispatcher->addEventListener($queue, $listener);

Send events

<?php
/* @var $object Serializable */
$message = new BeanstalkMessage($object);
$dispatcher->send($queue, $message);
// onMessage method in $listener is called

统计信息

  • 总下载量: 419
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 3
  • 依赖项目数: 0
  • 推荐数: 1

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2012-12-06