aboutsummaryrefslogtreecommitdiffstats
path: root/library/cpp/messagebus/rain_check/core/sleep.h
blob: dc63c098df4d7a5a99fe9b56c77e0174c9812051 (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);
    };

}