Implemented hostsync operator.
h3rald h3rald@h3rald.com
Sun, 17 Jul 2016 17:25:56 +0200
2 files changed,
7 insertions(+),
2 deletions(-)
M
lib/min_comm.nim
→
lib/min_comm.nim
@@ -37,7 +37,7 @@ if not pair.isQuotation or vals.len != 2 or not vals[0].isStringLike or not vals[1].isStringLike:
raiseInvalid("Invalid host quotation") i.link.hosts.replace(vals[0].getString, vals[1].getString) cfgSet("hosts", %i.link.hosts) - i.push("OK".newVal) + i.push(@["OK".newSym].newVal) .symbol("hosts") do (i: In): var q = newSeq[MinValue](0).newVal@@ -63,5 +63,10 @@ if host != i.link.name:
res = res & " " & i.executeOnHost(host, q) i.eval("($1)" % res) + .symbol("hostsync") do (i: In): + var res = "" + for key, value in i.syncHosts().pairs: + res = res & " " & value + i.eval "($1) dprint!" % res .finalize()
M
lib/prelude.min
→
lib/prelude.min
@@ -85,7 +85,7 @@ (dprint pop) :dprint!
(put pop) :put! (:ms :q :check (check) (ms sleep q) while) :interval (call pop) :call! -(host print! ":" print! " (OK)" put! ('OK) >* dprint!) :linkcheck +(host print! ":" print! " (OK)" put! ('OK) >* dprint!) :hostcheck ; Socket constructors ((ipv4 stream tcp) ^socket) :tcp-socket