Module tower_abci::split
source · Expand description
Splits a single [Service] implementing all of ABCI into four cloneable
component services, each implementing one category of ABCI requests.
The component services share access to the main service via message-passing over buffered channels. This means that the component services can be cloned to provide shared access to the ABCI application, which processes requests sequentially with the following prioritization:
ConsensusRequests sent to theConsensusservice;MempoolRequests sent to theMempoolservice;SnapshotRequests sent to theSnapshotservice;InfoRequests sent to theInfoservice.
The ABCI service can execute these requests synchronously, in
Service::call, or asynchronously, by immediately
returning a future that will be executed on the caller’s task. Or, it can
split the difference and perform some amount of synchronous work and defer
the rest to be performed asynchronously.
Because each category of requests is handled by a different service, request
behavior can be customized on a per-category basis using Tower
Layers. For instance, load-shedding can be added to
InfoRequests but not ConsensusRequests, or different categories can
have different timeout policies, or different types of instrumentation.
Modules
Structs
Functions
service implementing all of ABCI into four cloneable
component services, each implementing one category of ABCI requests. See the
module documentation for details.