executor_test.h 786 B

1234567891011121314151617181920212223242526272829303132333435
  1. /**
  2. * @project Project
  3. * @brief TODO: add a brief
  4. * @author lz
  5. * @data 2023/7/11
  6. **/
  7. #pragma once
  8. #include "defines.hpp"
  9. #include "rabbitmq/executor_mq.hpp"
  10. class ExecutorTest: public ExecutorRabbitmq {
  11. public:
  12. static int test(int argc, char** agrv) {
  13. auto iter = ExecutorRabbitmq::iter();
  14. iter->connect();
  15. iter->addListen("exe_test", &func());
  16. LOG(INFO) << iter->size();
  17. return true;
  18. }
  19. static Error_manager func1(const std::string &in, std::string &out) {
  20. }
  21. static Error_manager func2(const std::string &in, std::string &out) {
  22. }
  23. typedef Error_manager (*MessageHandler)(const std::string &in, std::string &out);
  24. MessageHandler handle[] {
  25. &func1(),
  26. &func2()
  27. };
  28. };