|
StripeKit 0.1.1
Stripe integration toolkit for C++
|
Chooses which event loop outbound Stripe requests run on. More...
#include <Drogon.h>
Public Types | |
| enum class | Mode { Own , DrogonFramework , External } |
| Which loop to use. More... | |
Static Public Member Functions | |
| static EventLoopOptions | own () |
| Runs requests on a loop StripeKit starts and owns. | |
| static EventLoopOptions | drogon_framework () |
| Runs requests on the loop of the running Drogon application. | |
| static EventLoopOptions | external (trantor::EventLoop &loop) |
| Runs requests on a loop the application already owns. | |
Public Attributes | |
| Mode | mode = Mode::Own |
| Which loop to use. | |
| trantor::EventLoop * | loop = nullptr |
| The loop to use when mode is Mode::External. | |
Chooses which event loop outbound Stripe requests run on.
Use drogon_framework() inside a Drogon server so StripeKit shares the loop the application is already running, rather than starting a second one that competes with it. The default, own(), suits command-line tools and tests where there is no Drogon server.
|
strong |
|
static |
Runs requests on a loop StripeKit starts and owns.
|
static |
Runs requests on the loop of the running Drogon application.
Requires Drogon to be running; use this from inside a Drogon server.
|
static |
Runs requests on a loop the application already owns.
| loop | The loop to use. It must outlive the HTTP client. |
| trantor::EventLoop* stripekit::drogon::EventLoopOptions::loop = nullptr |
The loop to use when mode is Mode::External.
Ignored otherwise.