brandonhudson / Lightning

PHP micro framework for MQTT, letting you quickly connect, publish, and subscribe to topics.
Other
6 stars 1 forks source link

method 'listen' (line 372 in App.php) doesn't do anything if you set $loop = false #6

Closed metaneutrons closed 7 years ago

metaneutrons commented 7 years ago

If you don't want to auto-loop the listen-method, you set $loop=false. But due to the while-condition the code after while never get's executed when $loop=false. This is easy to fix. E.g.:

public function listen($loop = true) {
    $looping = true;
    while ($looping) {
                // do listening stuff here
        }
        $looping = $loop;
    }

    return 1;
}
brandonhudson commented 7 years ago

Fixed in version 0.9.2