30 lines
472 B
Nim
Raw Normal View History

import pkg/chronicles
import pkg/chronos
2025-02-05 14:05:18 +01:00
import pkg/metrics
import ./list
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)
proc aaa() {.async.} =
while true:
notice "a"
await sleepAsync(1000)
2025-02-05 14:05:18 +01:00
exampleList.add("str!")
asyncSpawn aaa()
2025-02-05 11:06:18 +01:00
await sleepAsync(1000)
notice "b"