/// References to `@remote` functions (ADR 0072): what `std/dist`'s /// `spawn_on` takes to start one on another node. /// /// @remote /// fn worker :: job: Job -> () / { ... } /// /// dist.spawn_on node worker job 5000 /// /// `worker` called (`worker job`) is a function call, as for any /// function; its name used as a value is a `Remote`, never a /// closure: wrap it in a lambda to pass it as one. /// A `@remote` function whose argument is an `a`. Only the compiler makes /// one, from the function's name: its key is the hash of the function's /// qualified name (docs/wire-format.md, *Remote entries*), the same on /// every node that runs the program. `a` is phantom, so a `Remote` that /// came off the wire may name any key at any `a`: `spawn_on` checks both /// before it sends anything (`UnknownEntry`, `WrongType`). pub opaque type Remote { Remote(key: Int) } /// The key that names `entry` to every node of the cluster. pub fn key :: entry: Remote -> Int { match entry { Remote(key) -> key } }