-
Task
-
Resolution: Done
-
Major
-
None
-
None
Client will be able to receive events when changes occor on the resultset of the specified query. Three kind of events are available: JOINING, LEAVING and UPDATED.
Setup will be as follow:
ContinuousQueryListener<int, sample_bank_account::User> cql(testCache,"select id from sample_bank_account.User"); std::function<void(int, sample_bank_account::User)> join = [](int k, sample_bank_account::User u) { std::cout << "JOINING: key="<< u.id() << " value="<< u.name() << std::endl; }; std::function<void(int, sample_bank_account::User)> leave =[](int k, sample_bank_account::User u) { std::cout << "LEAVING: key="<< u.id() << " value="<< u.name() << std::endl; }; std::function<void(int, sample_bank_account::User)> change =[](int k, sample_bank_account::User u) { std::cout << "CHANGING: key="<< u.id() << " value="<< u.name() << std::endl; }; cql.setJoiningListener(join); cql.setLeavingListener(leave); cql.setUpdatedListener(change); testCache.addContinuousQueryListener(cql);