blob: 9b475b00fc69be527e7ea20323a5c37b5531b84e (
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
|
// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
#include "request_generator.h"
namespace vbench {
RequestGenerator::RequestGenerator(const string &inputFile,
Handler<Request> &next)
: _input(inputFile),
_next(next),
_aborted(false)
{
}
void
RequestGenerator::abort()
{
_aborted = true;
}
void
RequestGenerator::run()
{
string line;
while (!_aborted && _input.readLine(line)) {
Request::UP request(new Request());
request->url(line);
_next.handle(std::move(request));
}
}
} // namespace vbench
|