2025-02-04 16:25:38 +01:00
|
|
|
import pkg/chronicles
|
|
|
|
|
import pkg/chronos
|
|
|
|
|
|
2025-02-05 14:05:18 +01:00
|
|
|
import pkg/metrics
|
|
|
|
|
|
|
|
|
|
import ./list
|
|
|
|
|
|
2025-02-04 16:25:38 +01:00
|
|
|
logScope:
|
|
|
|
|
topics = "main"
|
|
|
|
|
|
2025-02-05 14:05:18 +01:00
|
|
|
declareGauge(example, "testing")
|
|
|
|
|
|
2025-02-05 10:52:15 +01:00
|
|
|
proc startApplication*() {.async.} =
|
2025-02-05 14:05:18 +01:00
|
|
|
proc onExampleMetric(value: int64) =
|
|
|
|
|
example.set(value)
|
|
|
|
|
var exampleList = List[string].new(onExampleMetric)
|
|
|
|
|
|
2025-02-04 16:25:38 +01:00
|
|
|
proc aaa() {.async.} =
|
|
|
|
|
while true:
|
|
|
|
|
notice "a"
|
|
|
|
|
await sleepAsync(1000)
|
2025-02-05 14:05:18 +01:00
|
|
|
exampleList.add("str!")
|
|
|
|
|
|
2025-02-04 16:25:38 +01:00
|
|
|
|
|
|
|
|
asyncSpawn aaa()
|
2025-02-05 11:06:18 +01:00
|
|
|
|
2025-02-04 16:25:38 +01:00
|
|
|
await sleepAsync(1000)
|
|
|
|
|
|
|
|
|
|
notice "b"
|