diff --git a/src/syndicate.nim b/src/syndicate.nim index b82d21a..34a75bf 100644 --- a/src/syndicate.nim +++ b/src/syndicate.nim @@ -150,7 +150,7 @@ template onStop*(body: untyped): untyped = proc getCurrentFacet(): Facet {.inject, used.} = facet body -template asserting*(a: Preserve): untyped = +template publish*(a: Preserve): untyped = mixin getCurrentFacet getCurrentFacet().addEndpoint do (_: Facet) -> EndpointSpec: result.assertion = a diff --git a/src/syndicate/drivers/timers.nim b/src/syndicate/drivers/timers.nim index 9042e60..8f9e94b 100644 --- a/src/syndicate/drivers/timers.nim +++ b/src/syndicate/drivers/timers.nim @@ -29,8 +29,8 @@ syndicate timerDriver: if period > 0: getCurrentFacet().beginExternalTask() addTimer(period.int, oneshot = true) do (fd: AsyncFD) -> bool: - react: asserting: prsTimeLaterThan(deadline) + react: publish: prsTimeLaterThan(deadline) getCurrentFacet().endExternalTask() true else: - react: asserting: prsTimeLaterThan(deadline) + react: publish: prsTimeLaterThan(deadline) diff --git a/tests/chat.nim b/tests/chat.nim index 10c9a74..147dd74 100644 --- a/tests/chat.nim +++ b/tests/chat.nim @@ -28,7 +28,7 @@ syndicate chat: echo who, " says ", what spawn "chat": - asserting present(me) + publish present(me) during (present(me)): let inputFacet = getCurrentFacet() diff --git a/tests/test_dsl.nim b/tests/test_dsl.nim index 14945e8..6d9da6b 100644 --- a/tests/test_dsl.nim +++ b/tests/test_dsl.nim @@ -11,7 +11,7 @@ syndicate testDsl: spawn "box": field(currentValue, BiggestInt, 0) - asserting prsBoxState(currentValue.get) + publish prsBoxState(currentValue.get) stopIf currentValue.get == 10: echo "box: terminating" onMessage(prsSetBox(?newValue)) do (newValue: int):