Use runActor proc
This commit is contained in:
parent
a49ea40a0f
commit
fb0e2ae62c
|
@ -1,4 +1,5 @@
|
||||||
include_rules
|
include_rules
|
||||||
: foreach ../*.prs |> !preserves_schema_nim |> | {schema}
|
: foreach ../*.prs |> !preserves_schema_nim |> | {schema}
|
||||||
: uri_runner.nim | $(SYNDICATE_PROTOCOL) {schema} |> !nim_bin |>
|
: uri_runner.nim | $(SYNDICATE_PROTOCOL) {schema} |> !nim_bin |> {bin}
|
||||||
: xdg_open.nim | $(SYNDICATE_PROTOCOL) {schema} |> !nim_bin |> $(BIN_DIR)/xdg-open
|
: xdg_open.nim | $(SYNDICATE_PROTOCOL) {schema} |> !nim_bin |> $(BIN_DIR)/xdg-open {bin}
|
||||||
|
: foreach {bin} |> !assert_built |>
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
# SPDX-FileCopyrightText: ☭ 2022 Emery Hemingway
|
# SPDX-FileCopyrightText: ☭ Emery Hemingway
|
||||||
# SPDX-License-Identifier: Unlicense
|
# SPDX-License-Identifier: Unlicense
|
||||||
|
|
||||||
import std/[asyncdispatch, re]
|
import std/[asyncdispatch, re]
|
||||||
|
@ -13,10 +13,9 @@ proc rewrite(result: var Assertion; uri: string; regex: Regex) =
|
||||||
pr.string = replacef(uri, regex, pr.string)
|
pr.string = replacef(uri, regex, pr.string)
|
||||||
apply(result, op)
|
apply(result, op)
|
||||||
|
|
||||||
bootDataspace("main") do (root: Ref; turn: var Turn):
|
runActor("main") do (root: Ref; turn: var Turn):
|
||||||
var handlers: seq[RegexAction]
|
|
||||||
|
|
||||||
connectStdio(root, turn)
|
connectStdio(root, turn)
|
||||||
|
var handlers: seq[RegexAction]
|
||||||
|
|
||||||
onPublish(turn, root, ?ActionHandler) do (pat: string; entity: Ref; response: Assertion):
|
onPublish(turn, root, ?ActionHandler) do (pat: string; entity: Ref; response: Assertion):
|
||||||
handlers.add (re(pat, {reIgnoreCase, reStudy}), entity, response,)
|
handlers.add (re(pat, {reIgnoreCase, reStudy}), entity, response,)
|
||||||
|
@ -37,5 +36,3 @@ bootDataspace("main") do (root: Ref; turn: var Turn):
|
||||||
# The Syndicate server retracts all assertions when
|
# The Syndicate server retracts all assertions when
|
||||||
# the config is rewritten.
|
# the config is rewritten.
|
||||||
handlers.setLen 0
|
handlers.setLen 0
|
||||||
|
|
||||||
runForever()
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
# Package
|
# Package
|
||||||
|
|
||||||
version = "20230412"
|
version = "20230506"
|
||||||
author = "Emery"
|
author = "Emery"
|
||||||
description = "A better xdg-open"
|
description = "A better xdg-open"
|
||||||
license = "Unlicense"
|
license = "Unlicense"
|
||||||
|
|
Loading…
Reference in New Issue