blob: 204ba784c69dc7ce83daa6340403f65b650a4481 (
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
|
// Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
#include "sourcesessionparams.h"
#include "dynamicthrottlepolicy.h"
namespace mbus {
SourceSessionParams::SourceSessionParams() :
_replyHandler(nullptr),
_throttlePolicy(std::make_shared<DynamicThrottlePolicy>()),
_timeout(180s)
{ }
IThrottlePolicy::SP
SourceSessionParams::getThrottlePolicy() const
{
return _throttlePolicy;
}
SourceSessionParams &
SourceSessionParams::setThrottlePolicy(IThrottlePolicy::SP throttlePolicy)
{
_throttlePolicy = std::move(throttlePolicy);
return *this;
}
SourceSessionParams &
SourceSessionParams::setTimeout(duration timeout)
{
_timeout = timeout;
return *this;
}
bool
SourceSessionParams::hasReplyHandler() const
{
return _replyHandler != nullptr;
}
IReplyHandler &
SourceSessionParams::getReplyHandler() const
{
return *_replyHandler;
}
SourceSessionParams &
SourceSessionParams::setReplyHandler(IReplyHandler &handler)
{
_replyHandler = &handler;
return *this;
}
} // namespace mbus
|