RTBKit
0.9
Open-source framework to create real-time ad bidding systems.
|
#include <async_event_source.h>
Public Member Functions | |
PeriodicEventSource (double timePeriodSeconds, std::function< void(uint64_t)> onTimeout, bool singleThreaded=true) | |
void | init (double timePeriodSeconds, std::function< void(uint64_t)> onTimeout, bool singleThreaded=true) |
virtual int | selectFd () const |
virtual bool | processOne () |
virtual bool | singleThreaded () const |
An async event source that can deal with multiple events.
Definition at line 117 of file async_event_source.h.
bool Datacratic::PeriodicEventSource::processOne | ( | ) | [virtual] |
Process a single message and return true if there are more to be processed.
This may be called from more than one thread if singleThreaded() is false.
Implements Datacratic::AsyncEventSource.
Definition at line 120 of file async_event_source.cc.
int Datacratic::PeriodicEventSource::selectFd | ( | ) | const [virtual] |
Return the file descriptor on which one should select() for messages from this source. The source should organize itself such that if the fd indicates ready for a read, there is something to do.
Should return -1 if it requires polling.
Should never block.
Reimplemented from Datacratic::AsyncEventSource.
Definition at line 113 of file async_event_source.cc.
virtual bool Datacratic::PeriodicEventSource::singleThreaded | ( | ) | const [inline, virtual] |
Return whether the callbacks need to be called from a single thread or not.
Reimplemented from Datacratic::AsyncEventSource.
Definition at line 134 of file async_event_source.h.