22 lines
498 B
Nim
Raw Normal View History

2024-12-24 11:47:38 +01:00
import chronos
import waku/waku_core
2024-12-24 11:47:38 +01:00
type TopicHealth* = enum
UNHEALTHY
MINIMALLY_HEALTHY
SUFFICIENTLY_HEALTHY
NOT_SUBSCRIBED
2024-12-24 11:47:38 +01:00
proc `$`*(t: TopicHealth): string =
result =
case t
of UNHEALTHY: "UnHealthy"
of MINIMALLY_HEALTHY: "MinimallyHealthy"
of SUFFICIENTLY_HEALTHY: "SufficientlyHealthy"
of NOT_SUBSCRIBED: "NotSubscribed"
2024-12-24 11:47:38 +01:00
type TopicHealthChangeHandler* = proc(
pubsubTopic: PubsubTopic, topicHealth: TopicHealth
): Future[void] {.gcsafe, raises: [Defect].}