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

+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;
}