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
|
/**
*
* TestPlugin.h
*
*/
#pragma once
#include <drogon/plugins/Plugin.h>
using namespace drogon;
class TestPlugin : public Plugin<TestPlugin>
{
public:
TestPlugin()
{
}
/// This method must be called by drogon to initialize and start the plugin.
/// It must be implemented by the user.
void initAndStart(const Json::Value &config) override;
/// This method must be called by drogon to shutdown the plugin.
/// It must be implemented by the user.
void shutdown() override;
private:
std::thread workThread_;
bool stop_{false};
int interval_{0};
};
|