Build without tracing

This commit is contained in:
Emery Hemingway 2024-03-11 14:40:42 +00:00
parent 8ef95c0e1d
commit 1592fac3b1
2 changed files with 12 additions and 12 deletions

View File

@ -6,14 +6,13 @@ import pkg/cps
import pkg/sys/ioqueue
import preserves
import ../syndicate/protocols/[protocol, sturdy]
import ../syndicate/protocols/[protocol, sturdy, trace]
const tracing = defined(traceSyndicate)
when tracing:
import std/streams
from std/os import getEnv
import ./protocols/trace
export Handle
@ -132,17 +131,18 @@ proc labels(f: Facet): string =
result.add f.actor.name
catLabels(f, result)
proc `$`*(f: Facet): string =
"<Facet:" & f.labels & ">"
when tracing:
proc `$`*(f: Facet): string =
"<Facet:" & f.labels & ">"
proc `$`*(r: Cap): string =
"<Ref:" & r.relay.labels & ">"
proc `$`*(r: Cap): string =
"<Ref:" & r.relay.labels & ">"
proc `$`*(actor: Actor): string =
"<Actor:" & actor.name & ">" # TODO: ambigous
proc `$`*(actor: Actor): string =
"<Actor:" & actor.name & ">" # TODO: ambigous
proc `$`*(t: Turn): string =
"<Turn:" & $t.desc.id & ">"
proc `$`*(t: Turn): string =
"<Turn:" & $t.desc.id & ">"
proc attenuate*(r: Cap; a: Attenuation): Cap =
if a.len == 0: result = r
@ -564,7 +564,7 @@ template recallFacet(turn: var Turn; body: untyped): untyped =
let facet = turn.facet
block:
body
assert facet.actor == turn.facet.actor, "turn of " & $facet.actor & " ended at " & $turn.facet.actor
assert facet.actor == turn.facet.actor
turn.facet = facet
proc stopNow(turn: var Turn) =

View File

@ -1,6 +1,6 @@
# Package
version = "20240308"
version = "20240311"
author = "Emery Hemingway"
description = "Syndicated actors for conversational concurrency"
license = "Unlicense"