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

View File

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