16 Star 44 Fork 11

inhere/php-queue

加入 Gitee
与超过 1400万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
queue.php 703 Bytes
一键复制 编辑 原始数据 按行查看 历史
inhere 提交于 2018-03-07 11:13 +08:00 . remove dep inhere/library. add other package dep
<?php
/**
* Created by PhpStorm.
* User: inhere
* Date: 2017/5/29
* Time: 上午11:05
*/
use Inhere\Queue\QueueInterface;
require dirname(__DIR__) . '/../../autoload.php';
$q = \Inhere\Queue\Queue::make([
'driver' => 'sysv', // shm sysv php
'id' => 12,
'serializer' => 'serialize',
'deserializer' => 'unserialize',
]);
//var_dump($q);
echo "driver is: {$q->getDriver()}\n\n";
$r[] = $q->push('n1');
$r[] = $q->push('n2');
$r[] = $q->push(['n3-array-value']);
$r[] = $q->push('h1', QueueInterface::PRIORITY_HIGH);
$r[] = $q->push('l1', QueueInterface::PRIORITY_LOW);
$r[] = $q->push('n4');
//var_dump($r);
$i = 6;
while ($i--) {
var_dump($q->pop());
usleep(50000);
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
PHP
1
https://gitee.com/inhere/php-queue.git
git@gitee.com:inhere/php-queue.git
inhere
php-queue
php-queue
master

搜索帮助