7 unstable releases (3 breaking)

0.4.1 Dec 3, 2023
0.4.0 Dec 1, 2023
0.3.1 Nov 23, 2023
0.2.0 Nov 16, 2023
0.1.1 Oct 29, 2023

#8 in #map-reduce

Download history 5/week @ 2024-01-21 2/week @ 2024-01-28 65/week @ 2024-02-18 20/week @ 2024-02-25 14/week @ 2024-03-03 43/week @ 2024-03-10 20/week @ 2024-03-17 41/week @ 2024-03-31 51/week @ 2024-04-07 81/week @ 2024-04-14 115/week @ 2024-04-21 16/week @ 2024-04-28

264 downloads per month
Used in paladin-core

MIT/Apache

10KB
113 lines

A derive macro for the RemoteExecute trait.

This construction enables operations to be serialized and executed by a remote service in an opaque manner. It uses the linkme crate to collect all operation execution pointers into a single slice that are gathered into a contiguous section of the binary by the linker.

Implementation details

A globally unique identifier is assigned to each operation. Then, a unique function that handles deserialization, execution, and re-serialization of the result is generated for each operation. A pointer to this function is registered with the distributed slice at the index of the operation's identifier. This allows execution function to be dereferenced by only the operation identifier, which is serialized with the task.

This scheme allows the tasks sent to workers to be opaque, while still enabling efficient lookup and execution of the appropriate operation.

Dependencies

~315–770KB
~18K SLoC