cron.h 468 B

123456789101112131415161718
  1. #pragma once
  2. #include <util/generic/ptr.h>
  3. #include <util/generic/function.h>
  4. #include <util/datetime/base.h>
  5. namespace NCron {
  6. struct IHandle {
  7. virtual ~IHandle();
  8. };
  9. using TJob = std::function<void()>;
  10. using IHandlePtr = TAutoPtr<IHandle>;
  11. IHandlePtr StartPeriodicJob(TJob job);
  12. IHandlePtr StartPeriodicJob(TJob job, TDuration interval);
  13. IHandlePtr StartPeriodicJob(TJob job, TDuration interval, const TString& threadName);
  14. }