misc.h 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. #pragma once
  2. #include <library/cpp/messagebus/rain_check/core/rain_check.h>
  3. #include <array>
  4. namespace NRainCheck {
  5. struct TNopSimpleTask: public ISimpleTask {
  6. TNopSimpleTask(IEnv*, const void*) {
  7. }
  8. TContinueFunc Start() override {
  9. return nullptr;
  10. }
  11. };
  12. struct TNopCoroTask: public ICoroTask {
  13. TNopCoroTask(IEnv*, const void*) {
  14. }
  15. void Run() override {
  16. }
  17. };
  18. struct TSpawnNopTasksCoroTask: public ICoroTask {
  19. IEnv* const Env;
  20. unsigned const Count;
  21. TSpawnNopTasksCoroTask(IEnv* env, unsigned count)
  22. : Env(env)
  23. , Count(count)
  24. {
  25. }
  26. std::array<TSubtaskCompletion, 2> Completion;
  27. void Run() override;
  28. };
  29. struct TSpawnNopTasksSimpleTask: public ISimpleTask {
  30. IEnv* const Env;
  31. unsigned const Count;
  32. TSpawnNopTasksSimpleTask(IEnv* env, unsigned count)
  33. : Env(env)
  34. , Count(count)
  35. {
  36. }
  37. std::array<TSubtaskCompletion, 2> Completion;
  38. TContinueFunc Start() override;
  39. TContinueFunc Join();
  40. };
  41. }