Ivan FB 4dfe72e12f
messaging & channels: per-layer api/ folders + concentrator
Extract the messaging (send/subscription) and reliable-channel
(lifecycle/send) operations into their own api/ folders with events moved to
the owning layer, thin messaging_client and reliable_channel_manager, and add
the LogosDelivery concentrator that aggregates the per-layer APIs.

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

19 lines
630 B
Nim

## Messaging layer API — subscription operations.
import results, chronos
import logos_delivery/api/types
import logos_delivery/messaging/messaging_client
import logos_delivery/waku/node/[waku_node, subscription_manager]
proc subscribe*(
self: MessagingClient, contentTopic: ContentTopic
): Future[Result[void, string]] {.async.} =
?self.checkApiAvailability()
return self.node.subscriptionManager.subscribe(contentTopic)
proc unsubscribe*(
self: MessagingClient, contentTopic: ContentTopic
): Result[void, string] =
?self.checkApiAvailability()
return self.node.subscriptionManager.unsubscribe(contentTopic)