aclk_query.h 993 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. // SPDX-License-Identifier: GPL-3.0-or-later
  2. #ifndef NETDATA_ACLK_QUERY_H
  3. #define NETDATA_ACLK_QUERY_H
  4. #include "libnetdata/libnetdata.h"
  5. #include "mqtt_wss_client.h"
  6. #include "aclk_query_queue.h"
  7. extern pthread_cond_t query_cond_wait;
  8. extern pthread_mutex_t query_lock_wait;
  9. #define QUERY_THREAD_WAKEUP pthread_cond_signal(&query_cond_wait)
  10. #define QUERY_THREAD_WAKEUP_ALL pthread_cond_broadcast(&query_cond_wait)
  11. // TODO
  12. //extern volatile int aclk_connected;
  13. struct aclk_query_thread {
  14. netdata_thread_t thread;
  15. int idx;
  16. mqtt_wss_client client;
  17. };
  18. struct aclk_query_threads {
  19. struct aclk_query_thread *thread_list;
  20. int count;
  21. };
  22. void aclk_query_threads_start(struct aclk_query_threads *query_threads, mqtt_wss_client client);
  23. void aclk_query_threads_cleanup(struct aclk_query_threads *query_threads);
  24. const char *aclk_query_get_name(aclk_query_type_t qt, int unknown_ok);
  25. int mark_pending_req_cancelled(const char *msg_id);
  26. #endif //NETDATA_AGENT_CLOUD_LINK_H