async_set

异步写单行数据

  1. ///
  2. /// \brief asynchronous set
  3. /// store the k-v to the cluster.
  4. /// will not be blocked, return immediately.
  5. /// key is composed of hashkey and sortkey.
  6. /// \param hashkey
  7. /// used to decide which partition to put this k-v
  8. /// \param sortkey
  9. /// all the k-v under hashkey will be stored by sortkey.
  10. /// \param value
  11. /// the value we want to store.
  12. /// \param callback
  13. /// the callback function will be invoked after operation finished or error occurred.
  14. /// \param timeout_milliseconds
  15. /// if wait longer than this value, will return time out error.
  16. /// \param ttl_seconds
  17. /// time to live of this value, if expired, will return not found; 0 means no ttl.
  18. /// \return
  19. /// void.
  20. ///
  21. virtual void async_set(const std::string &hashkey,
  22. const std::string &sortkey,
  23. const std::string &value,
  24. async_set_callback_t &&callback = nullptr,
  25. int timeout_milliseconds = 5000,
  26. int ttl_seconds = 0) = 0;