2024 日本 PHP 研討會

msg_queue_exists

(PHP 5 >= 5.3.0, PHP 7, PHP 8)

msg_queue_exists檢查訊息佇列是否存在

說明

msg_queue_exists(int $key): bool

檢查訊息佇列 key 是否存在。

參數

key

佇列鍵值。

回傳值

成功時返回 true,失敗時返回 false

另請參閱

新增筆記

使用者貢獻的筆記 1 則筆記

1
michael dot hajuu at gmail dot com
13 年前
一個簡單的腳本,用於檢查在[可能是新的]伺服器環境中正在使用的訊息佇列。

使用 php-cli 執行

<?php
$k
= 0;
while (
true) {
echo
$key,"...\r";
if (
msg_queue_exists($key))
echo
"\r",$key,'::存在',"\n";
$key++;
}
?>
To Top