LiveBlocking::Start
Instructs the live gateway to start sending data. This call will block until the DBN metadata is decoded.
Info
A session cannot be started more than once.
Returns
DBN Metadata about the subscription(s).
API method
1
Metadata Start(); Example usage
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
#include <databento/live.hpp>
#include <iostream>
using namespace databento;
auto client = LiveBlocking::Builder()
.SetKey("$YOUR_API_KEY")
.SetDataset("OPRA.PILLAR")
.SetCompression(Compression::Zstd)
.BuildBlocking();
client.Subscribe({"SPXW.OPT"}, Schema::Trades, SType::Parent);
auto metadata = client.Start();
std::cout << "DBN metadata version "
// cast to avoid printing version as a char
<< static_cast<std::uint16_t>(metadata.version)
<< " and dataset " << metadata.dataset << '\n'; Example response
1
DBN metadata version 3 and dataset OPRA.PILLAR