From 89474e72364984c8eb59fbe988efe835bdcbdc82 Mon Sep 17 00:00:00 2001 From: Ivan FB Date: Thu, 25 Jun 2026 15:43:39 +0200 Subject: [PATCH] Expose reliable-channel ops in the stable C header (#3851) The library already ships as a single .so with a tiered header surface (liblogosdelivery.h = stable Messaging/Reliable-Channels, liblogosdelivery_kernel.h = advanced Kernel). Per that tiering, the reliable-channel ops belong on the stable surface, so declare channel_create / channel_send / channel_close in liblogosdelivery.h and document the channel lifecycle events delivered through the event callback. Co-Authored-By: Claude Opus 4.8 --- library/liblogosdelivery.h | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/library/liblogosdelivery.h b/library/liblogosdelivery.h index 3965ef013..7b4bbd5ab 100644 --- a/library/liblogosdelivery.h +++ b/library/liblogosdelivery.h @@ -71,6 +71,36 @@ extern "C" void *userData, const char *messageJson); + // --- Reliable Channels API (stable surface) --- + + // Create a reliable channel. Returns the channel id. + int logosdelivery_channel_create(void *ctx, + FFICallBack callback, + void *userData, + const char *channelId, + const char *contentTopic, + const char *senderId); + + // Send a message on a reliable channel. + // messageJson: { "payload": "base64-encoded-payload", "ephemeral": false } + // Returns a request ID that can be used to track delivery. + int logosdelivery_channel_send(void *ctx, + FFICallBack callback, + void *userData, + const char *channelId, + const char *messageJson); + + // Close a reliable channel: stops its SDS loops; persisted state survives, so + // re-creating the channel restores it. + int logosdelivery_channel_close(void *ctx, + FFICallBack callback, + void *userData, + const char *channelId); + + // Channel lifecycle events are delivered through the event callback set via + // logosdelivery_set_event_callback: "onChannelMessageReceived" (payload + // base64-encoded), "onChannelMessageSent", "onChannelMessageError". + // Sets a callback that will be invoked whenever an event occurs. // It is crucial that the passed callback is fast, non-blocking and potentially thread-safe. void logosdelivery_set_event_callback(void *ctx,