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 |
2,208 downloads per month
Used in paladin-core
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