Ivan FB c64d156f2a
FFI: migrate liblogosdelivery root to nim-ffi v0.2.0-rc.3
Rewrite the FFI root over the new per-layer APIs using nim-ffi v0.2.0 typed
{.ffiCtor.}/{.ffiDtor.}/{.ffi.}/{.ffiEvent.} + CBOR, replacing the
hand-written cstring/JSON bridge. Events are fed by internal nim-broker
listeners (no AppCallbacks). Adds the messaging_api/channels_api groups and
the broker-listener event modules, and drops the v0.1 scaffolding
(declare_lib, node_api, node_lifecycle_api, logos_delivery_api/*, json_*).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-25 04:18:35 +02:00

10 lines
397 B
Nim

proc messaging_send*(
self: LogosDelivery, contentTopic: string, payload: seq[byte], ephemeral: bool
): Future[Result[string, string]] {.ffi.} =
let envelope = MessageEnvelope.init(
contentTopic = ContentTopic(contentTopic), payload = payload, ephemeral = ephemeral
)
let requestId = (await self.messagingClient.send(envelope)).valueOr:
return err(error)
return ok($requestId)