Uploaded image for project: 'Hot Rod Native client'
  1. Hot Rod Native client
  2. HRCPP-381

Add continuous queries support

    XMLWordPrintable

Details

    Description

      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);
      

      Attachments

        Issue Links

          Activity

            People

              vrigamon@redhat.com Vittorio Rigamonti
              vrigamon@redhat.com Vittorio Rigamonti
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: