sleep.h 534 B

123456789101112131415161718192021222324
  1. #pragma once
  2. #include "fwd.h"
  3. #include <library/cpp/messagebus/scheduler/scheduler.h>
  4. #include <util/datetime/base.h>
  5. namespace NRainCheck {
  6. class TSleepService {
  7. private:
  8. THolder< ::NBus::NPrivate::TScheduler> SchedulerHolder;
  9. ::NBus::NPrivate::TScheduler* const Scheduler;
  10. public:
  11. TSleepService(::NBus::NPrivate::TScheduler*);
  12. TSleepService();
  13. ~TSleepService();
  14. // Wake up a task after given duration.
  15. void Sleep(TSubtaskCompletion* r, TDuration);
  16. };
  17. }