代码拉取完成,页面将自动刷新
同步操作将从 inhere/php-queue 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
php的队列使用包装, 默认自带支持 高 high
中 norm
低 low
三个级别的队列操作。
DbQueue
基于数据库的队列实现PhpQueue
基于 php SplQueue
实现RedisQueue
基于 redis 实现ShmQueue
基于共享内存实现SysVQueue
基于 *nix 系统的 system v message 实现. php 需启用 --enable-sysvmsg
通常是默认开启的 :){
"require": {
"inhere/queue": "dev-master"
}
}
git clone https://git.oschina.net/inhere/php-queue.git // git@osc
git clone https://github.com/inhere/php-queue.git // github
// file: examples/queue.php
use inhere\queue\QueueInterface;
// require __DIR__ . '/autoload.php';
$q = \inhere\queue\Queue::make([
'driver' => 'sysv', // shm sysv php
'id' => 12,
]);
//var_dump($q);
$q->push('n1');
$q->push('n2');
$q->push(['n3-array-value']);
$q->push('h1', QueueInterface::PRIORITY_HIGH);
$q->push('l1', QueueInterface::PRIORITY_LOW);
$q->push('n4');
$i = 6;
while ($i--) {
var_dump($q->pop());
usleep(50000);
}
run php examples/queue.php
. output:
% php examples/queue.php 17-06-11 - 22:36:01
driver is sysv
string(2) "h1"
string(2) "n1"
string(2) "n2"
array(1) {
[0] =>
string(11) "array-value"
}
string(2) "l1"
MIT
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。