-
Notifications
You must be signed in to change notification settings - Fork 41
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
React Event loop #105
Comments
3 items, not 4 |
// Subscribe multiple channels
$channels = [
['topic' => '/market/ticker:XHV-USDT']
['topic' => '/market/ticker:XHV-USDT'],
['topic' => '/spotMarket/tradeOrders'],
['topic' => '/account/balance'],
]; |
`<?php require DIR . '/vendor/autoload.php'; use Ratchet\Client\WebSocket; //KuCoinApi::setBaseUri('https://openapi-sandbox.kucoin.com'); // Logging in your code if($BOT['settings']['debug']['enabled']){KuCoinApi::getLogger()->debug("ku-xhv-ws-bot logging started...");} require ( 'vendor/phpclasses/circular-buffer/CircularBuffer.phpclass' ) ; $auth = null; //$api_account = new Account($auth);
});
}, function ($code, $reason) {
}, function ($code, $reason) { ?>` gets the price, I never see any order updates or account info messages |
I can access the api in the full version of the script just fine for my account in the synchronous version |
be great to have a barebones example that works with the private feed EDIT: I cant seem to figure out how to connect to the Private Channels websocket feed altogether (I only ever get the public channel subscription symbol ticker updates) "The recommended way is to just create a websocket connection and subscribe to multiple channels." .... yes I'd love to, how? |
`<?php use KuCoin\SDK\Exceptions\HttpException; use Ratchet\Client\WebSocket; //KuCoinApi::setBaseUri('https://openapi-sandbox.kucoin.com'); $BOT=array(); KuCoinApi::setDebugMode($BOT['settings']['debug']['enabled']); $auth = null; $api = new WebSocketFeed($auth); $BOT['orders']=array(); }); //$api->setLoop($loop); //$query_private = ['connectId' => uniqid('', true)]; $channels = [ $api->setLoop($loop); printf("\n\nPublic running??\n\n"); // never see that message ?> |
commenting $loop->run(); in Private websocket subscribe channels solved my concurrency issue... still not getting any balance or orders messages, I do see welcome, ping and pong for both the connections (private - to get my details & public - to get the currency prices etc) |
$query_pri = ['connectId' => uniqid('', true),'privateChannel'=>true,'response'=>true]; was needed, wasn't obvious because there's no example demonstrating privateChannel subscription |
Can you paste where you put |
How would I go about using the websocketfeed to get
['topic' => '/market/ticker:XHV-USDT']
['topic' => '/market/ticker:XHV-USDT'],
['topic' => '/spotMarket/tradeOrders'],
['topic' => '/account/balance']
into a single event loop, is there any example that covers having these 4 items push, having one call to the api->subscribePrivateChannels seems to block the next...
The text was updated successfully, but these errors were encountered: