seqeron 0.18.0
Loading...
Searching...
No Matches
Consumer.hpp
Go to the documentation of this file.
1#pragma once
2
3#include <cstdint>
4
6#include "org/limitless/seqeron/hosted/detail/ClientLink.hpp"
7
9
20template<typename Listener>
21class Consumer : public detail::ClientLink<Consumer<Listener>, Listener>
22{
23 using Base = detail::ClientLink<Consumer<Listener>, Listener>;
24 friend Base;
25
26 public:
27 struct Config
28 {
29 // The host's heartbeat counter may be silent this long before the stub gives it up (H-9, section 17.6).
30 std::int64_t hostTimeoutMs = 3000;
31 std::int64_t attachTimeoutMs = 90'000;
32 // Names the host this attaches to, the one its proxy.hostName gives; the attach is refused otherwise.
34 };
35
36 Consumer(Config config, Listener& listener) :
37 Base{ listener, wire::Kind::CONSUMER, -1, nullptr, config.hostTimeoutMs, config.attachTimeoutMs, config.hostName,
38 false }
39 {
41 }
42
43 private:
44 // The hooks of ClientLink: a consumer is sent neither.
45 void onGate(bool)
46 {}
47
48 void onOther(std::uint16_t, char*, aeron::util::index_t, std::uint16_t, std::uint16_t)
49 {}
50};
51
52} // namespace org::limitless::seqeron::hosted
The client stub of a hosted Consumer (doc/seqeron-protocol-spec.md ยง17.1): the surface of app::Consum...
Definition Consumer.hpp:22
Consumer(Config config, Listener &listener)
Definition Consumer.hpp:36
What a Consumer's Listener provides.
Definition Listeners.hpp:35
Definition Application.hpp:12
constexpr const char * PROXY_DEFAULT_HOST_NAME
Definition ProxyProtocol.hpp:11
std::string hostName
Definition Consumer.hpp:33
std::int64_t hostTimeoutMs
Definition Consumer.hpp:30
std::int64_t attachTimeoutMs
Definition Consumer.hpp:31