mirror of
https://github.com/logos-messaging/logos-messaging-nim.git
synced 2026-06-27 11:59:26 +00:00
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>
19 lines
630 B
Nim
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)
|