dfx 0.1.0
Linux-based dynamic dataflow executor
Loading...
Searching...
No Matches
MqDestination.hpp
1// SPDX-FileCopyrightText: 2026 Vincent Leroy
2// SPDX-License-Identifier: MIT
3//
4// This file is part of dfx.
5//
6// Licensed under the MIT License. See the LICENSE file in the project root
7// for full license information.
8
9#pragma once
10
11// Project includes
12#include "DestinationTransport.hpp"
13#include <dfx-utilities/OwnedFd.hpp>
14
15namespace dfx::Core
16{
29{
30public:
36
37public:
39 void start(FdWatch::Poller & poller) override;
40
42 void stop() noexcept override;
43
49 bool deliver(MessagePtr message) override;
50
52 int64_t pendingMessageCount() const noexcept override;
53
54private:
55 Utils::OwnedFd _mqfd;
56};
57} // !namespace dfx:Core
DestinationTransport(Endpoint endpoint, nlohmann::json config)
Constructs a DestinationTransport with the Role::Destination role.
Definition DestinationTransport.hpp:32
Definition Endpoint.hpp:24
void stop() noexcept override
Closes the underlying file descriptor.
void start(FdWatch::Poller &poller) override
Opens the POSIX Message Queue for writing.
bool deliver(MessagePtr message) override
Serializes and writes a message to the Message Queue.
MqDestination(Endpoint endpoint, nlohmann::json config)
Initializes the MQ destination.
int64_t pendingMessageCount() const noexcept override
Queries the MQ attributes for the current message count.
Endpoint const & endpoint() const noexcept
Gets the endpoint descriptor associated with this transport.
Definition Transport.hpp:161
nlohmann::json const & config() const noexcept
Gets the JSON configuration used to initialize this transport.
Definition Transport.hpp:176
Abstract interface for FD-based event polling.
Definition Poller.hpp:37
Definition Channel.hpp:25
std::unique_ptr< Message > MessagePtr
Unique ownership handle for messages.
Definition Message.hpp:27
Definition SystemConfigCommandHandler.hpp:15