本文整理汇总了PHP中msg_get_queue函数的典型用法代码示例。如果您正苦于以下问题:PHP msg_get_queue函数的具体用法?PHP msg_get_queue怎么用?PHP msg_get_queue使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了msg_get_queue函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: __construct
public function __construct()
{
$this->ipc_fn = tempnam(sys_get_temp_dir(), 'csp.' . uniqid('chn', true));
$this->key = ftok($this->ipc_fn, 'A');
$this->ipc = msg_get_queue($this->key, 0666);
msg_set_queue($this->ipc, $cfg = ['msg_qbytes' => 1 * PHP_INT_LENGTH]);
}
开发者ID:straiway,项目名称:fmt,代码行数:7,代码来源:csp.php
示例2: __construct
/**
* Init Tunnel.
*/
public function __construct()
{
$this->parentPID = getmypid();
$this->bridge = $this->createBridge();
$this->queue = msg_get_queue(ftok(__FILE__, 'k'));
pcntl_signal(POLL_MSG, [$this, 'read']);
}
开发者ID:komex,项目名称:tunnel,代码行数:10,代码来源:Tunnel.php
示例3: shutdown
public function shutdown()
{
$this->queue = msg_get_queue(ftok($this->file, 'R'), 0777);
for ($i = 0; $i < $this->numThreads * 2; $i++) {
msg_send($this->queue, 100 + $i, 'shutdown');
}
}
开发者ID:level-2,项目名称:aphplication,代码行数:7,代码来源:Aphplication.php
示例4: actionDequeue
public function actionDequeue($qId, $data)
{
$q = msg_get_queue($qId);
$r = msg_receive($q, 1, $msgType, 10000, $msg);
echo "Result: " . $r . "<br/>";
echo " Got msg: " . $msg;
}
开发者ID:Clarence-pan,项目名称:test,代码行数:7,代码来源:TestMessageQueueController.php
示例5: getInstance
public static function getInstance()
{
if (!self::$_queue) {
self::$_queue = msg_get_queue(self::LC_MSG_KEY);
}
return self::$_queue;
}
开发者ID:hlxabcd,项目名称:log_center,代码行数:7,代码来源:LC_C_PHP_Logger.php
示例6: __construct
public function __construct($id, $info)
{
$this->id = $id;
$this->info = $info;
$this->msgSemKey = sem_get(9876543210);
$this->queKey = msg_get_queue(123456788);
}
开发者ID:FIU-SCIS-Senior-Projects,项目名称:GPA2,代码行数:7,代码来源:toLog.php
示例7: __construct
public function __construct(Config $config)
{
$this->ownerPid = $config->get('ownerPid');
$this->ipcKey = new IpcKey($this->ownerPid, str_replace('\\', '_', get_class($this)));
$this->id = msg_get_queue($this->ipcKey->generate());
$this->stat = msg_stat_queue($this->id);
}
开发者ID:ackintosh,项目名称:snidel,代码行数:7,代码来源:AbstractQueue.php
示例8: getQueue
private function getQueue()
{
if ($this->_queue === null) {
$this->_queue = msg_get_queue($this->getKey(), $this->permissions);
}
return $this->_queue;
}
开发者ID:highestgoodlikewater,项目名称:yii2-nfy,代码行数:7,代码来源:SysVQueue.php
示例9: initQueue
protected function initQueue()
{
if (null !== $this->msgHandle) {
return;
}
$this->msgHandle = msg_get_queue($this->getId());
}
开发者ID:emente,项目名称:kataii---kata-framework-2.x,代码行数:7,代码来源:event.php
示例10: initialize
public function initialize()
{
if ($this->queuePath) {
return;
}
$this->queuePath = KATATMP . 'queue' . DS;
if (defined('QUEUE_IDENTIFIER')) {
$this->queueId = QUEUE_IDENTIFIER;
} else {
if (defined('CACHE_IDENTIFIER')) {
$this->queueId = (int) hexdec(md5(CACHE_IDENTIFIER));
} else {
$this->queueId = ftok(__FILE__);
}
}
switch ($this->method) {
case null:
throw new Exception('You have to setMethod() first');
break;
case self::QM_MSGQUEUE:
$this->queueRes = msg_get_queue($this->queueId, 0666);
break;
case self::QM_ZEROMQ:
break;
case self::QM_LIBEVENT:
break;
case self::QM_FILESOCKET:
break;
case self::QM_FILESYS:
break;
}
//switch
}
开发者ID:emente,项目名称:kataii---kata-framework-2.x,代码行数:33,代码来源:queue.php
示例11: setKey
public function setKey($key)
{
if ($this->key !== $key) {
$this->key = $key;
$this->queue = msg_get_queue($this->key);
}
}
开发者ID:ssdphp,项目名称:ssdphp,代码行数:7,代码来源:Php.php
示例12: __construct
public function __construct($queue_file)
{
if (!file_exists($queue_file)) {
throw new Exception("Could not find mailbox: {$queue_file}");
}
$this->queue_id = msg_get_queue(ftok($queue_file, 'r'), 0666);
}
开发者ID:blamh,项目名称:ipc_mailbox,代码行数:7,代码来源:Sender.php
示例13: __construct
/**
* Create a ParallelChildCollector that will collect
* issues as normal, but emit them to a message queue
* for collection by a
* \Phan\Output\Collector\ParallelParentCollector.
*/
public function __construct()
{
assert(extension_loaded('sysvsem'), 'PHP must be compiled with --enable-sysvsem in order to use -j(>=2).');
assert(extension_loaded('sysvmsg'), 'PHP must be compiled with --enable-sysvmsg in order to use -j(>=2).');
// Create a message queue for this process group
$message_queue_key = posix_getpgid(posix_getpid());
$this->message_queue_resource = msg_get_queue($message_queue_key);
}
开发者ID:nagyistge,项目名称:phan,代码行数:14,代码来源:ParallelChildCollector.php
示例14: getQueue
protected function getQueue($queueName)
{
if (!isset($this->semaphore[$queueName])) {
$id = crc32($queueName);
$this->semaphore[$queueName] = msg_get_queue($id);
}
return $this->semaphore[$queueName];
}
开发者ID:riverline,项目名称:worker-bundle,代码行数:8,代码来源:Semaphore.php
示例15: initQueue
/**
* init queue
*
* @param $ipc_filename
* @param $msg_type
* @throws \Exception
*/
protected function initQueue($ipc_filename, $msg_type)
{
$this->key_t = $this->getIpcKey($ipc_filename, $msg_type);
$this->queue = \msg_get_queue($this->key_t);
if (!$this->queue) {
throw new \RuntimeException('msg_get_queue failed');
}
}
开发者ID:asuper114,项目名称:simple-fork-php,代码行数:15,代码来源:SystemVMessageQueue.php
示例16: __construct
/**
* @param EventDispatcherInterface $dispatcher
* @param array $customEvents Custom events to proxy to parent process.
*/
public function __construct(EventDispatcherInterface $dispatcher, array $customEvents = [])
{
$this->dispatcher = $dispatcher;
$class = new \ReflectionClass('\\Unteist\\Event\\EventStorage');
$this->events = array_unique(array_values($class->getConstants() + $customEvents));
$this->parentPID = getmypid();
$this->queue = msg_get_queue(ftok(__FILE__, 'U'));
}
开发者ID:komex,项目名称:unteist,代码行数:12,代码来源:Connector.php
示例17: __construct
/**
* @param int $ownerPid
* @param int $maxProcs
*/
public function __construct($ownerPid, $maxProcs)
{
$this->keyPrefix = uniqid((string) mt_rand(1, 100), true);
$this->ownerPid = $ownerPid;
$this->maxProcs = $maxProcs;
$this->id = msg_get_queue($this->genId());
$this->initializeQueue();
}
开发者ID:TomoakiNagahara,项目名称:snidel,代码行数:12,代码来源:Token.php
示例18: getQueue
/**
* Get queue
*
* @return resource
*/
public function getQueue()
{
if (!($this->queue = msg_get_queue($this->qid, 0666))) {
throw new Hush_Message_Exception("Get queue " . $this->name . " failed");
return false;
}
return $this->queue;
}
开发者ID:liningwang,项目名称:camera-beijing,代码行数:13,代码来源:Queue.php
示例19: init_queue
/**
* 初始化一个队列
* @param $ipc_filename
* @param $msg_type
* @throws Exception
*/
public function init_queue($ipc_filename, $msg_type)
{
$this->key_t = $this->get_ipc_key($ipc_filename, $msg_type);
$this->queue = \msg_get_queue($this->key_t);
if (!$this->queue) {
throw new \Exception('msg_get_queue failed');
}
}
开发者ID:gzweb,项目名称:Zebra-PHP-Framework,代码行数:14,代码来源:SystemVMessageQueue.class.php
示例20: init
/**
* @throws \RuntimeException
*/
protected function init()
{
$file = sprintf("%s/%s", sys_get_temp_dir(), base64_encode($this->identifier));
@touch($file);
$this->queue = msg_get_queue(ftok($file, 'm'));
if (!$this->queue) {
throw new \RuntimeException("Unable to get message queue");
}
}
开发者ID:alexanderc,项目名称:threadator,代码行数:12,代码来源:MsgQueue.php
注:本文中的msg_get_queue函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论