mirror of
https://github.com/uroni/urbackup_backend.git
synced 2025-10-26 11:36:50 +00:00
24 lines
534 B
C++
24 lines
534 B
C++
#ifndef IPIPETHROTTLER_H
|
|
#define IPIPETHROTTLER_H
|
|
|
|
#include "Object.h"
|
|
#include <string>
|
|
|
|
class IPipeThrottlerUpdater : public IObject
|
|
{
|
|
public:
|
|
virtual int64 getUpdateIntervalMs()=0;
|
|
|
|
virtual size_t getThrottleLimit(bool& percent_max)=0;
|
|
};
|
|
|
|
class IPipeThrottler : public IObject
|
|
{
|
|
public:
|
|
virtual bool addBytes(size_t n_bytes, bool wait)=0;
|
|
virtual void changeThrottleLimit(size_t bps, bool p_percent_max)=0;
|
|
virtual void changeThrottleUpdater(IPipeThrottlerUpdater* new_updater)=0;
|
|
};
|
|
|
|
|
|
#endif //IPIPETHROTTLER_H
|