Fix #27 - return true on subscribe_to_objects

This commit is contained in:
Daniel Larimer 2015-06-09 16:24:55 -04:00
parent d1f3ce8543
commit 666ffd07ae
2 changed files with 6 additions and 4 deletions

View file

@ -381,14 +381,16 @@ namespace graphene { namespace app {
}
}
void database_api::subscribe_to_objects( const std::function<void(const fc::variant&)>& callback, const vector<object_id_type>& ids)
bool database_api::subscribe_to_objects( const std::function<void(const fc::variant&)>& callback, const vector<object_id_type>& ids)
{
for(auto id : ids) _subscriptions[id] = callback;
return true;
}
void database_api::unsubscribe_from_objects(const vector<object_id_type>& ids)
bool database_api::unsubscribe_from_objects(const vector<object_id_type>& ids)
{
for(auto id : ids) _subscriptions.erase(id);
return true;
}
void database_api::subscribe_to_market(std::function<void(const variant&)> callback, asset_id_type a, asset_id_type b)

View file

@ -182,13 +182,13 @@ namespace graphene { namespace app {
* @param callback Callback method which is called with the new version of a changed object
* @param ids The set of object IDs to watch
*/
void subscribe_to_objects(const std::function<void(const fc::variant&)>& callback,
bool subscribe_to_objects(const std::function<void(const fc::variant&)>& callback,
const vector<object_id_type>& ids);
/**
* @brief Stop receiving notifications for some object(s)
* @param ids The set of object IDs to stop watching
*/
void unsubscribe_from_objects(const vector<object_id_type>& ids);
bool unsubscribe_from_objects(const vector<object_id_type>& ids);
/**
* @brief Request notification when the active orders in the market between two assets changes
* @param callback Callback method which is called when the market changes