@walkor
使用的workerman\mqtt組件需求是在一個機子上啟動subscribe訂閱,同時也要處理單次的publish發(fā)布。
但是在啟動subscribe時,在publish就提示already running已經(jīng)運行了,按照例子來說執(zhí)行了兩次
Worker::runAll(),所有請問下publish能不能單獨調(diào)用
[attach]1288[/attach]
[attach]1289[/attach]
就是看publish能不能不依托為workerman能不能用,使其可以項目內(nèi)調(diào)用
運行 php xxx.php start 后,workerman會記錄xxx.php 已經(jīng)啟動( 通過pid文件記錄的),再次運行? php xxx.php start后會禁止再次啟動,提示already running。
你可以嘗試根據(jù)不同的命令設置不同的pid,比如
php index.php a/b/c start 設置 Worker::$pidFile = '/home/pid/abc.pid';
php index.php e/f/g start 設置?Worker::$pidFile = '/home/pid/efg.pid';
這樣應該不會提示already running。
pidFile設置參考手冊?http://doc.workerman.net/worker/pid-file.html
?workerman\mqtt 必須在workerman運行環(huán)境下才能使用。
?