|
nanoMMO 0.97.8
Building an MMO: The Engineering Series
|
#include <recorder.h>
Public Types | |
| using | Sink = std::function<absl::Status(std::string_view rows)> |
| Stores a batch of rows, one a line, or says why it couldn't. | |
Public Member Functions | |
| Recorder (Redis &redis, std::string consumer, Sink sink, std::chrono::milliseconds wait=std::chrono::seconds(1)) | |
| Waits up to wait each time for events to come, as the consumer. | |
| absl::StatusOr< int > | Record () |
Static Public Attributes | |
| static constexpr char | kGroup [] = "recorder" |
| static constexpr int | kBatch = 10'000 |
| The most rows a batch takes. | |
Takes the game's events from the Redis stream the worlds add them to, a batch at a time, to the sink, which puts them into ClickHouse.
Definition at line 17 of file recorder.h.
| using nanommo::Recorder::Sink = std::function<absl::Status(std::string_view rows)> |
Stores a batch of rows, one a line, or says why it couldn't.
Definition at line 20 of file recorder.h.
| nanommo::Recorder::Recorder | ( | Redis & | redis, |
| std::string | consumer, | ||
| Sink | sink, | ||
| std::chrono::milliseconds | wait = std::chrono::seconds(1) ) |
Waits up to wait each time for events to come, as the consumer.
Definition at line 13 of file recorder.cc.
| absl::StatusOr< int > nanommo::Recorder::Record | ( | ) |
Records a batch: first what it took before and couldn't store, then what's new. Returns how many it stored.
Definition at line 20 of file recorder.cc.
|
staticconstexpr |
The most rows a batch takes.
Definition at line 28 of file recorder.h.
|
staticconstexpr |
The consumer group the recorders read the stream as. Redis gives each entry to one consumer of the group, and remembers which it's given out and not had acknowledged.
Definition at line 25 of file recorder.h.