feat(messaging): implement P3 S-MESSAGING-01..04 Messaging queue, StorageQueue/OutboxInbox, and MessagingRpc adapter

This commit is contained in:
faumaray committed 2026-11-27 05:45:43 +03:00
1 parent aaeab50758
commit 60ee28e4ca
17 files changed
+4641

No files matched your search

+5
View File
@@ -328,6 +328,11 @@ if(_has_scheduler)
run_consumer(SchedulerOnly "${install_prefix}" "SchedulerOnly" ${_no_external_deps})
endif()
has_modules(_has_messaging Messaging Core Functional Binary Time Async)
if(_has_messaging)
run_consumer(MessagingOnly "${install_prefix}" "MessagingOnly" ${_no_external_deps})
endif()
# Foundation consumer with Core-formatting bridge and zero external packages.
has_modules(_has_foundation Math Text Time Functional Binary FunctionalCoreFormatting Memory Core)
if(_has_foundation)
@@ -0,0 +1,14 @@
cmake_minimum_required(VERSION 4.0)
project(VoidMessagingOnlyConsumer LANGUAGES CXX)
set(CMAKE_CXX_STANDARD 26)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
find_package(Void REQUIRED CONFIG COMPONENTS Messaging)
add_executable(messaging_only main.cpp)
target_link_libraries(messaging_only PRIVATE Void::Messaging)
enable_testing()
add_test(NAME messaging_only COMMAND messaging_only)
+33
View File
@@ -0,0 +1,33 @@
#include <Void/Messaging/Queue.hpp>
#include <cstdlib>
int main()
{
Void::Messaging::InMemoryQueue q{};
if (!q.create_queue(Void::Messaging::QueueConfig{.name = "q"}).has_value()) {
return EXIT_FAILURE;
}
if (!q.create_group("q", Void::Messaging::GroupConfig{.name = "g"})
.has_value()) {
return EXIT_FAILURE;
}
Void::Messaging::Message m{};
m.id = "m1";
m.payload = {std::byte{0x41}};
auto pub = q.publish("q", m, Void::Messaging::PublishDurability::Memory);
if (!pub.has_value()) {
return EXIT_FAILURE;
}
auto del = q.try_receive("q", "g");
if (!del.has_value() || !del->has_value()) {
return EXIT_FAILURE;
}
if (!q.ack((*del)->receipt).has_value()) {
return EXIT_FAILURE;
}
if (!q.close_and_join().has_value()) {
return EXIT_FAILURE;
}
return EXIT_SUCCESS;
}