当前位置: 首页>>代码示例>>PHP>>正文


PHP msg_get_queue函数代码示例

本文整理汇总了PHP中msg_get_queue函数的典型用法代码示例。如果您正苦于以下问题:PHP msg_get_queue函数的具体用法?PHP msg_get_queue怎么用?PHP msg_get_queue使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了msg_get_queue函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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


注:本文中的msg_get_queue函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。