File: SlowCtrl.h

package info (click to toggle)
drogon 1.9.0%2Bds-1
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 4,096 kB
  • sloc: cpp: 52,222; sh: 249; xml: 20; makefile: 11
file content (20 lines) | stat: -rw-r--r-- 642 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#pragma once
#include <drogon/HttpController.h>
using namespace drogon;

class SlowCtrl : public drogon::HttpController<SlowCtrl>
{
  public:
    METHOD_LIST_BEGIN
    ADD_METHOD_TO(SlowCtrl::hello, "/slow?userid={userid}", Get, "TimeFilter");
    ADD_METHOD_TO(SlowCtrl::observe, "/observe?userid={userid}", Get);
    METHOD_LIST_END

    void hello(const HttpRequestPtr &req,
               std::function<void(const HttpResponsePtr &)> &&callback,
               std::string &&userid);
    drogon::AsyncTask observe(
        HttpRequestPtr req,
        std::function<void(const HttpResponsePtr &)> callback,
        std::string userid);
};