aboutsummaryrefslogtreecommitdiffstats
path: root/library/cpp/threading/cron/cron.h
blob: 77fa40c5e20a052bb9bc0d108966c69412b9e0d4 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#pragma once

#include <util/generic/ptr.h>
#include <util/generic/function.h>
#include <util/datetime/base.h>

namespace NCron {
    struct IHandle {
        virtual ~IHandle();
    };

    using TJob = std::function<void()>;
    using IHandlePtr = TAutoPtr<IHandle>;

    IHandlePtr StartPeriodicJob(TJob job);
    IHandlePtr StartPeriodicJob(TJob job, TDuration interval);
    IHandlePtr StartPeriodicJob(TJob job, TDuration interval, const TString& threadName);
}