-
Notifications
You must be signed in to change notification settings - Fork 649
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
add optional subscribe option to get_ticker #2001
Conversation
@@ -1280,6 +1283,9 @@ market_ticker database_api_impl::get_ticker( const string& base, const string& q | |||
{ | |||
orders = get_order_book(assets[0]->symbol, assets[1]->symbol, 1); | |||
} | |||
if( to_subscribe ) | |||
subscribe_to_item( itr->id ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is not sufficient.
-
Currently we don't return
id
inmarket_ticker
, so the client don't know whatid
is for what. -
I guess, when the data changed, only the
id
will be pushed to the client, so the client need to callget_objects
to get the new data. This is not good enough. We'd better push the data directly.
It's |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
test
possible to have this feature in v4.0? @abitmore @oxarbitrage e.g refactoring the market_ticker object like below.
|
@crazybits thanks for the info. We'll consider it. |
I see what i can do. How do we compute |
yes, return the base or quote asset volume of lowest_ask and highest_bid price in the orderbook |
In regards to the subscription to tickers we were talking with @abitmore that this will need a refactor of the subscription system or some other medium to big refactor that we will not do right now. The approach of this pull will just get a raw ticker object that is not what we need. I think the PR can be closed but feel free to reopen if not. |
For issue #1937
While testing this i found that all the apis that have subscribe in this manner is that it is actually true by default when the option is not present(
get_assets
,get_accounts
, etc).Most probably nobody noticed as it will not start sending data without
set_subscribe_callback
.Not sure if this is what we want, i was expecting a false by default.