Uses new Rust 2021
|0.6.0||Jul 5, 2022|
#219 in Testing
62 downloads per month
Used in 3 crates
This crate holds the raw modules for Fledger. They are written in a way to be as reusable as possible. For this, most modules have the following structure:
broker.rs- which contains the code to interact with the other modules
module.rs- with the main code of the module, with at least a
process_msgmethod that inputs a message and outputs a vector of answers
- data-structures - implementing the basic functionality of the module.
Currently the following modules are available:
random_connectionstakes a list of nodes and randomly selects enough nodes for a fully connected network
random_connectionsto send regular messages to the connected nodes to make sure they answer. If a node doesn't answer in due time, a failure message is emitted.
gossip_eventsexchanges events emitted by the nodes and updates the list. It works both in active mode - sending new messages to neighbours - as in passive mode - requesting list of available events from other nodes.
I wanted to create a common code for both the libc- and wasm-implementation for
Unfortunately it is difficult by the fact that libc allows to use threads
(and sometimes needs them), so some structures need to have the
But these traits are not available for all necessary websys-modules!
So I came up with the idea of linking all modules using a
In short, all input and output for a module are defined as messages.
Then each module handles incoming messages and produces outgoing messages.
Modules can be linked together by defining
Translators that take messages
from one module and translate them into messages for the other module.