aboutsummaryrefslogtreecommitdiffstats
path: root/yt/yt/core/misc/fair_scheduler.h
blob: 7f7d607667c79640a0f46f1ff71ce1aacf2bd48f (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
25
26
27
28
29
30
31
32
33
#pragma once

#include "public.h"

namespace NYT {

////////////////////////////////////////////////////////////////////////////////

template <class TTask>
struct IFairScheduler
    : public TRefCounted
{
    virtual void Enqueue(TTask task, const TString& user) = 0;

    virtual TTask Dequeue() = 0;

    virtual bool IsEmpty() const = 0;

    virtual void ChargeUser(const TString& user, TDuration time) = 0;
};

////////////////////////////////////////////////////////////////////////////////

template <class TTask>
IFairSchedulerPtr<TTask> CreateFairScheduler();

////////////////////////////////////////////////////////////////////////////////

} // namespace NYT

#define FAIR_SCHEDULER_INL_H_
#include "fair_scheduler-inl.h"
#undef FAIR_SCHEDULER_INL_H_