Quantum Resource Manager and Compiler Infrastructure (QRM&CI) 0.1.0
CommunicationHandler.h File Reference
Include dependency graph for CommunicationHandler.h:
This graph shows which files directly or indirectly include this file:

Classes

class  mqss::qrmci::CommunicationHandler
 CommunicationHandler abstracts the messaging operations that move pipeline messages between QRM&CI stages. More...

Functions

mqss::TransportOptions< mqss::RabbitMqSimple > mqss::qrmci::makeTransportOptions (const RabbitMqConnectionConfig &config)
 Translate a RabbitMqConnectionConfig into the transport's own options.
std::string mqss::qrmci::messageLabel (const mqss::QuantumTask &task)
 Describe a quantum task for an error or log line.
std::string mqss::qrmci::messageLabel (const mqss::QuantumResult &result)
 Describe a quantum result for an error or log line.
std::string mqss::qrmci::messageLabel (const mqss::Backend &backend)
 Describe a backend status snapshot for an error or log line.
template<class Message>
std::string mqss::qrmci::messageLabel (const Message &)=delete
 No generic fallback: a message type with no more specific overload above must fail to compile here rather than silently receive the generic label message in every log line and error it appears in.

Variables

constexpr std::chrono::milliseconds mqss::qrmci::DefaultReceiveTimeout {500}
 How long a single receive attempt waits when the caller does not say, and the interval an indefinite receive polls at.
constexpr std::chrono::milliseconds mqss::qrmci::WaitForever {-1}
 Timeout value meaning "poll until a message arrives or the termination flag is set" rather than returning after a bounded wait.

Detailed Description

The RabbitMQ send/receive helpers that carry tasks, results and backend status between QRM&CI stages.

Definition in file CommunicationHandler.h.

Function Documentation

◆ makeTransportOptions()

mqss::TransportOptions< mqss::RabbitMqSimple > mqss::qrmci::makeTransportOptions ( const RabbitMqConnectionConfig & config)
nodiscard

Translate a RabbitMqConnectionConfig into the transport's own options.

Exposed (rather than kept file-local) so a test can assert that every configured field actually reaches the transport, instead of only asserting the struct it was given.

◆ messageLabel() [1/4]

template<class Message>
std::string mqss::qrmci::messageLabel ( const Message & )
delete

No generic fallback: a message type with no more specific overload above must fail to compile here rather than silently receive the generic label message in every log line and error it appears in.

Template Parameters
MessageThe message type being described.

◆ messageLabel() [2/4]

std::string mqss::qrmci::messageLabel ( const mqss::Backend & backend)
inline

Describe a backend status snapshot for an error or log line.

Parameters
backendThe backend status to describe.
Returns
A human-readable label, e.g. backend status for backend alpha.

Definition at line 67 of file CommunicationHandler.h.

◆ messageLabel() [3/4]

std::string mqss::qrmci::messageLabel ( const mqss::QuantumResult & result)
inline

Describe a quantum result for an error or log line.

Parameters
resultThe result to describe.
Returns
A human-readable label, e.g. quantum result for task 7.

Definition at line 60 of file CommunicationHandler.h.

◆ messageLabel() [4/4]

std::string mqss::qrmci::messageLabel ( const mqss::QuantumTask & task)
inline

Describe a quantum task for an error or log line.

Parameters
taskThe task to describe.
Returns
A human-readable label, e.g. quantum task 7.

Definition at line 53 of file CommunicationHandler.h.

Variable Documentation

◆ DefaultReceiveTimeout

std::chrono::milliseconds mqss::qrmci::DefaultReceiveTimeout {500}
inlineconstexpr

How long a single receive attempt waits when the caller does not say, and the interval an indefinite receive polls at.

Definition at line 32 of file CommunicationHandler.h.

◆ WaitForever

std::chrono::milliseconds mqss::qrmci::WaitForever {-1}
inlineconstexpr

Timeout value meaning "poll until a message arrives or the termination flag is set" rather than returning after a bounded wait.

A negative sentinel rather than 0ms, because 0ms already means "poll once and return immediately if nothing is available" – the same convention the underlying transport uses for ReceiveArgs::timeout.

Definition at line 41 of file CommunicationHandler.h.