skip to content
[readonly]

The SDK of native worker programs: mesh_worker_run(init, task) maps meshd's mailbox, says ready, and runs a slot's nodes at each run until they halt

sh
$ sexc add @ajax/mesh-worker
  • total 3
  • drwxr-xr-x-../
  • drwxr-xr-x-Oct 27 02:57v/# 1 version
  • drwxr-xr-x-Oct 27 02:57files/# the files of 0.1.0
latest
0.1.0, published Oct 27 02:57 by ajax
owners
ajax
license
MIT
dependencies
@ajax/mesh-worker-node ^0.1.0, @ajax/mesh-worker-ctx ^0.1.0, @ajax/mesh-mailbox ^0.1.0, @ajax/mesh-abi-native ^0.1.0, @ajax/mesh-abi-base ^0.1.0, @ajax/mesh-abi-header ^0.1.0, @ajax/mesh-abi-control-block ^0.1.0, @ajax/mesh-abi-program-table ^0.1.0, @ajax/mesh-check ^0.1.0
dependents
@ajax/mesh-prog-gemm, @ajax/mesh-prog-pipesink, @ajax/mesh-prog-pipesrc-n, @ajax/mesh-test-worker
keywords
mesh alphaos worker native sdk process
homepage
https://github.com/thomasdavis/alpha-c-mesh/tree/main/packages/mesh-worker
repository
https://github.com/thomasdavis/alpha-c-mesh
==> README.md <==
1# @ajax/mesh-worker
2
3The SDK of native worker programs: `mesh_worker_run` checks the native ABI, maps meshd's mailbox from its descriptor, says `ready`, runs the slot's nodes at each `run <gen> <slot>`, says `halted <gen>`, and exits on SHUTDOWN_EXIT, `exit`, or EOF (meshd gone). `mesh_worker_panic` is Rust's panic: a message and status 101.
4
5## Differences
6
7- Rust's panic hook catches every panic; in C a program reports its own bugs with `mesh_worker_panic` (a signal is reported by meshd as a signal).
8- Commands are read with `read(2)`, not stdio, so a node that calls `exit()` never waits on a reader blocked in stdio.
9
10## Ported from
11
12[alpha-rust-mesh](https://github.com/rsafier/alpha-rust-mesh) (Richard Safier, MIT): crates/mesh-worker/src/lib.rs (`run`, `map_mailbox`, the command thread).
13
14## Tests
15
16Through @ajax/mesh-native's lifecycle tests, which run apps/mesh-test-worker (built on this SDK) under the native executor.
17
18## Licence
19
20MIT. See the repository's LICENSE.