aboutsummaryrefslogtreecommitdiffstats
path: root/library/cpp/actors/helpers/flow_controlled_queue.h
blob: bbfffa18d7f9a6d2ee5fd8cdeae4cb1ebcfb8c82 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#pragma once

#include <library/cpp/actors/core/actor.h>

namespace NActors {

    struct TFlowControlledQueueConfig {
        ui32 MinAllowedInFly = 20;
        ui32 MaxAllowedInFly = 100;
        ui32 TargetDynamicRate = 0;

        TDuration MinTrackedLatency = TDuration::MilliSeconds(20);
        ui32 LatencyFactor = 4;
    };

    template <class TEnum = IActor::EActivityType>
    IActor* CreateFlowControlledRequestQueue(TActorId targetId, const TEnum activity = IActor::EActivityType::ACTORLIB_COMMON, const TFlowControlledQueueConfig &config = TFlowControlledQueueConfig());

}