8 releases

new 0.4.2 Oct 15, 2024
0.4.1 Dec 3, 2023
0.3.1 Nov 23, 2023
0.2.0 Nov 16, 2023
0.1.1 Oct 29, 2023
Download history 519/week @ 2024-07-01 607/week @ 2024-07-08 605/week @ 2024-07-15 525/week @ 2024-07-22 229/week @ 2024-07-29 383/week @ 2024-08-05 645/week @ 2024-08-12 714/week @ 2024-08-19 552/week @ 2024-08-26 828/week @ 2024-09-02 522/week @ 2024-09-09 486/week @ 2024-09-16 625/week @ 2024-09-23 728/week @ 2024-09-30 399/week @ 2024-10-07 441/week @ 2024-10-14

2,208 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

~245–690KB
~17K SLoC