Socket thread on run
Hi,
I have a problem when I try to start the web socket on a thread.
public function run() { $this->api->trades(["BNBBTC"], function($api, $symbol, $trades) { echo "{$symbol} trades update" . PHP_EOL; print_r($trades); }); }
Thank you for your report. I have had multiple issues using RatchetPHP and hopefully someone smart can shine some light on the issue. (and add auto reconnect!)
There is no way to perform the socket on a thread other than the main thread?
Yeah this uses pawl, are you sure you have the right library?
I'm sure
This is error only on run of thread:
Uncaught Error: Class 'React\EventLoop\Factory' not found in C:\3 Stack trace:
Please confirm your setup. When you are using threads if i recall correctly you must proceed reference to other classes by first referring the global namespace with \ followed by the path to the class namespace.
I'm out for pints ill take a look at my multi threaded code maybe later
\ (backslash) is the namespace separator in PHP 5.3. A \ before the beginning of a function represents the Global Namespace. Putting it there will ensure that the function called is from the global namespace, even if there is a function by the same name in the current namespace