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