aboutsummaryrefslogtreecommitdiffstats
path: root/library/cpp/messagebus/rain_check/core/sleep.h
blob: 1a7a1f86741d370bba3513b09d1b3e4f8bf297a3 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#pragma once

#include "fwd.h"

#include <library/cpp/messagebus/scheduler/scheduler.h>

#include <util/datetime/base.h>

namespace NRainCheck {
    class TSleepService {
    private:
        THolder< ::NBus::NPrivate::TScheduler> SchedulerHolder;
        ::NBus::NPrivate::TScheduler* const Scheduler;

    public:
        TSleepService(::NBus::NPrivate::TScheduler*);
        TSleepService();
        ~TSleepService();

        // Wake up a task after given duration.
        void Sleep(TSubtaskCompletion* r, TDuration);
    };

}