dfx 0.1.0
Linux-based dynamic dataflow executor
Loading...
Searching...
No Matches
MqCommon.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// Standard includes
12#include <optional>
13#include <mqueue.h>
14
15// Third-party includes
16#include <nlohmann/json.hpp>
17
18// Project includes
19#include <dfx-utilities/OwnedFd.hpp>
20
22{
24{
25 std::optional<long> maxMessage;
26 std::optional<long> maxMessageSize;
27
28 bool hasAnyValueSet() const noexcept;
29 mq_attr toMqAttr() const noexcept;
30};
31
32void validateConfig(nlohmann::json const & config);
33
34void fillMqAttrWithConfig(OpenAttr & attr, nlohmann::json const & config);
35[[noreturn]] void onMqOpenFail(std::string_view addrUsed, OpenAttr const & attrUsed, int err);
36
37Utils::OwnedFd openMq(std::string const & addr, int flags, nlohmann::json const & config);
38} // !namespace dfx::Core::MqCommon
Owning RAII wrapper around a file descriptor.
Definition OwnedFd.hpp:36
Definition MqCommon.hpp:22
Definition MqCommon.hpp:24