Open lipflip opened 3 years ago
public function subscribeAndWaitForMessage($topic, $qos): string
{
$this->subscribe(
[
$topic => [
'qos' => $qos,
'function' => '__direct_return_message__'
]
]
);
$microtimeStart = microtime(true);
do {
$return = $this->proc();
$microtime = microtime(true);
if (($microtime - $microtimeStart) > 30 ){
$return = '{"rtErr":"Time exceeded !"}';
}
} while ($return === true);
return $return;
}
It would be great to have some timeout option, otherwise you have an endless loop,
this is not ok in some situations.