Utilities for the Syndicated Actor Model
Go to file
Emery Hemingway 818c23f025 Discard actor from bootDataspace 2023-07-01 16:06:18 +01:00
src Discard actor from bootDataspace 2023-07-01 16:06:18 +01:00
.envrc Better build system 2023-07-01 16:05:46 +01:00
.gitignore Remove http_translator 2023-05-07 09:22:47 +01:00
README.md Document the net_mapper 2023-07-01 16:06:18 +01:00
Tuprules.tup Syndicate API update 2023-04-10 10:46:50 -05:00
config.prs Add <connected "…"> assertion to json_socket_translator 2023-05-16 18:44:10 +01:00
mpv.config-example.pr Adjust to Syndicate-nim changes 2023-05-18 12:41:52 +01:00
net_mapper.prs Add lost net_mapper code 2023-07-01 16:06:16 +01:00
shell.nix Better build system 2023-07-01 16:05:46 +01:00
syndicate_utils.nimble Discard actor from bootDataspace 2023-07-01 16:06:18 +01:00

README.md

Syndicate utils

json_translator

Wrapper that executes a command, parses its JSON output, and asserts a Preserves conversion in an <output …> record.

json_socket_translator

Utility to communicate with sockets that send and receive lines of JSON using <sen-json …> and <recv-json …> messages. Compatible with mpv, see mpv.config-example.pr.

Do not send messages immediately to the dataspace passed json_socket_translator, wait until it asserts <connected @socketPath string>.

msg

A utility that sends a message to $SYNDICATE_SOCK in the form <ARGV0 ARG1 … ARGVn>. The $SYNDICATE_STEP variables sets the SturdyRef capability with a default to the SturdyRef generated by <ref { oid: "syndicate" key: #x"" }>.

net_mapper

Publishes ICMP packet round-trip-times. See net_mapper.prs for a protocol description. Source.

Example script:

? <machine-dataspace ?machine> [
  $machine ? <rtt "10.0.33.136" ?min ?avg ?max> [
    $log ! <log "-" { ping: { min: $min avg: $avg max: $max } }>
  ]

  $config [
    <require-service <daemon net_mapper>>
    <daemon net_mapper {
      argv: ["/bin/net_mapper"]
      protocol: application/syndicate
    }>
    ? <service-object <daemon net_mapper> ?cap> [
      $cap { dataspace: $machine }
    ]
  ]
]

preserve_process_environment

This utility serializes it's process environment to Preserves and prints it to stdout. It can be used to feed the environment variables of a nested child of the Syndicate server back to the server. For example, to retreive the environmental variables that a desktop manager passed on to its children.