logos-messaging-nim/library/messaging_api/subscriptions_api.nim
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

14 lines
441 B
Nim

proc subscribe*(
self: LogosDelivery, contentTopic: string
): Future[Result[string, string]] {.ffi.} =
(await self.messagingClient.subscribe(ContentTopic(contentTopic))).isOkOr:
return err(error)
return ok("")
proc unsubscribe*(
self: LogosDelivery, contentTopic: string
): Future[Result[string, string]] {.ffi.} =
self.messagingClient.unsubscribe(ContentTopic(contentTopic)).isOkOr:
return err(error)
return ok("")