forked from smyte/ratelimit
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathRateLimitServer.cpp
More file actions
28 lines (19 loc) · 770 Bytes
/
RateLimitServer.cpp
File metadata and controls
28 lines (19 loc) · 770 Bytes
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
#include <memory>
#include "pipeline/RedisPipelineBootstrap.h"
#include "ratelimit/RateLimitHandler.h"
namespace ratelimit {
static pipeline::RedisPipelineBootstrap::Config config{
redisHandlerFactory : [](pipeline::RedisPipelineBootstrap* bootstrap) -> std::shared_ptr<pipeline::RedisHandler> {
return std::make_shared<RateLimitHandler>(bootstrap->getDatabaseManager());
},
kafkaTailerFactoryMap : {},
databaseManagerFactory : nullptr,
scheduledTaskQueueFactory : nullptr,
rocksDbCfConfiguratorMap : {
{
pipeline::DatabaseManager::defaultColumnFamilyName(), RateLimitHandler::optimizeColumnFamily,
},
},
};
static auto redisPipelineBootstrap = pipeline::RedisPipelineBootstrap::create(config);
} // namespace ratelimit