mirror of
https://github.com/logos-messaging/logos-messaging-nim.git
synced 2026-06-26 11:29:28 +00:00
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>
14 lines
441 B
Nim
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("")
|