dfx 0.1.0
Linux-based dynamic dataflow executor
Loading...
Searching...
No Matches
DestinationTransport.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 "../../messages/Message.hpp"
13#include "../Transport.hpp"
14
15namespace dfx::Core
16{
26{
27public:
35
45 virtual bool deliver(MessagePtr message) = 0;
46
48 virtual int64_t pendingMessageCount() const noexcept { return -1; }
49};
50
51using DestinationTransportPtr = std::unique_ptr<DestinationTransport>;
52} // !namespace dfx::Core
virtual int64_t pendingMessageCount() const noexcept
Return the number of pending message in this transport or -1 if unknown.
Definition DestinationTransport.hpp:48
virtual bool deliver(MessagePtr message)=0
Performs the actual delivery of a message.
DestinationTransport(Endpoint endpoint, nlohmann::json config)
Constructs a DestinationTransport with the Role::Destination role.
Definition DestinationTransport.hpp:32
Definition Endpoint.hpp:24
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
Role
Defines the operational role of a transport relative to a channel.
Definition Transport.hpp:130
@ Destination
The transport acts as a message consumer for the channel.
Definition Transport.hpp:132
Transport(Role role, Endpoint endpoint, nlohmann::json config)
Constructs a transport instance.
Definition Channel.hpp:25
std::unique_ptr< Message > MessagePtr
Unique ownership handle for messages.
Definition Message.hpp:27
STL namespace.