1 Star 0 Fork 11

Aaron/php-queue

forked from inhere/php-queue 
加入 Gitee
与超过 1400万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
queue.php 703 Bytes
一键复制 编辑 原始数据 按行查看 历史
inhere 提交于 2017-06-11 22:45 +08:00 . some logic update. bug fixed
<?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/linshaoneng/php-queue.git
git@gitee.com:linshaoneng/php-queue.git
linshaoneng
php-queue
php-queue
master

搜索帮助