skip to content
[readonly]

One-shot replies between threads: a result (text, number or bytes, or an error) with a timeout

sh
$ sexc add @ajax/mesh-reply
  • total 3
  • drwxr-xr-x-../
  • drwxr-xr-x-Oct 27 05:23v/# 1 version
  • drwxr-xr-x-Oct 27 05:23files/# the files of 0.1.0
latest
0.1.0, published Oct 27 05:23 by ajax
owners
ajax
license
MIT
dependencies
@ajax/mesh-buf ^0.1.0, @ajax/mesh-chan ^0.1.0, @ajax/mesh-check ^0.1.0
dependents
@ajax/mesh-control, @ajax/mesh-driver, @ajax/mesh-fleetd, @ajax/mesh-jobd, @ajax/mesh-publish, @ajax/mesh-shared
keywords
mesh alphaos reply result threads
homepage
https://github.com/thomasdavis/alpha-c-mesh/tree/main/packages/mesh-reply
repository
https://github.com/thomasdavis/alpha-c-mesh
==> README.md <==
1# @ajax/mesh-reply
2
3One-shot replies between threads: a requester makes a reply, hands a sender reference to the thread that
4answers, and waits with a timeout for one `mesh_result` (Ok text, Ok number, Ok bytes, or an error). An
5answerer that drops its reference unanswered is seen by the waiter at once; an answer that arrives after
6the waiter gave up is freed with the channel.
7
8## Ported from
9
10[alpha-rust-mesh](https://github.com/rsafier/alpha-rust-mesh) (Richard Safier, MIT):
11`crates/mesh-host/src/shared.rs`'s `Reply` (`Sender<Result<String, String>>`), `TaskReply`
12(`Result<u32, String>`) and `HttpReply` (`Result<Vec<u8>, String>`): one C type for the three.
13
14## Tests
15
16- `tests/reply.c`: answered, dropped unanswered, answered from a thread, answered too late (no leak under
17  ASan), values, bytes and clones.
18
19## Licence
20
21MIT. See the repository's LICENSE.