Skip to content

Commit 0992541

Browse files
fix: make clippy happy
1 parent 7e5d68d commit 0992541

File tree

1 file changed

+33
-33
lines changed

1 file changed

+33
-33
lines changed

README.md

+33-33
Original file line numberDiff line numberDiff line change
@@ -14,18 +14,18 @@ etc.
1414
This crate uses Tower to define an asynchronous ABCI interface. It has two parts:
1515

1616
1. An ABCI server, which listens for connections and forwards ABCI requests
17-
to one of four user-provided [`Service`][svc]s, each responsible for processing
18-
one category of requests (consensus, mempool, info, or snapshot).
17+
to one of four user-provided [`Service`][svc]s, each responsible for processing
18+
one category of requests (consensus, mempool, info, or snapshot).
1919

2020
2. Middleware that splits a single [`Service`][svc] implementing all of ABCI
21-
into four cloneable component services, each implementing one category of
22-
requests. The component services use message-passing to share access to the
23-
main service, which processes requests with the following category-based
24-
prioritization:
25-
1. `ConsensusRequest`s sent to the `Consensus` service;
26-
2. `MempoolRequest`s sent to the `Mempool` service;
27-
3. `SnapshotRequest`s sent to the `Snapshot` service;
28-
4. `InfoRequest`s sent to the `Info` service.
21+
into four cloneable component services, each implementing one category of
22+
requests. The component services use message-passing to share access to the
23+
main service, which processes requests with the following category-based
24+
prioritization:
25+
1. `ConsensusRequest`s sent to the `Consensus` service;
26+
2. `MempoolRequest`s sent to the `Mempool` service;
27+
3. `SnapshotRequest`s sent to the `Snapshot` service;
28+
4. `InfoRequest`s sent to the `Info` service.
2929

3030
Because the ABCI server takes one service per category, users can apply Tower
3131
layers to the services they pass to the ABCI `Server` to add
@@ -35,33 +35,33 @@ These parts can be combined in different ways to provide different points on
3535
the tradeoff curve between implementation complexity and performance:
3636

3737
1. At the lowest level of complexity, application developers can implement an
38-
ABCI application entirely synchronously. To do this, they implement
39-
`Service<Request>` so that `Service::call` performs request processing and
40-
returns a ready future. Then they use `split::service` to create four
41-
component services that share access to their application, and use those to
42-
construct the ABCI `Server`. The application developer does not need to
43-
manage synchronization of shared state between different clones of their
44-
application, because there is only one copy of their application.
38+
ABCI application entirely synchronously. To do this, they implement
39+
`Service<Request>` so that `Service::call` performs request processing and
40+
returns a ready future. Then they use `split::service` to create four
41+
component services that share access to their application, and use those to
42+
construct the ABCI `Server`. The application developer does not need to
43+
manage synchronization of shared state between different clones of their
44+
application, because there is only one copy of their application.
4545

4646
2. At the next level of complexity, application developers can implement an
47-
ABCI application partially synchronously. As before, they implement
48-
`Service<Request>` to create a single ABCI application, but instead of
49-
processing all requests in the body of `Service::call`, they can defer
50-
processing of some requests by immediately returning a future that will be
51-
executed on the caller's task. Although all requests are still received by
52-
the application task, not all request processing needs to happen on the
53-
application task.
54-
At this level the developer must pay closer attention to utilising Tower
55-
layers to control the concurrency of the individual services mentioned above.
56-
In particular the `Consensus` service should be wrapped with
57-
`ServiceBuilder::concurrency_limit` of 1 to avoid a potential reordering of
58-
consensus message effects caused by concurrent execution, as well as
59-
`ServiceBuilder::buffer` to avoid any deadlocks in message handling in `Connection`
60-
due to the limited concurrency.
47+
ABCI application partially synchronously. As before, they implement
48+
`Service<Request>` to create a single ABCI application, but instead of
49+
processing all requests in the body of `Service::call`, they can defer
50+
processing of some requests by immediately returning a future that will be
51+
executed on the caller's task. Although all requests are still received by
52+
the application task, not all request processing needs to happen on the
53+
application task.
54+
At this level the developer must pay closer attention to utilising Tower
55+
layers to control the concurrency of the individual services mentioned above.
56+
In particular the `Consensus` service should be wrapped with
57+
`ServiceBuilder::concurrency_limit` of 1 to avoid a potential reordering of
58+
consensus message effects caused by concurrent execution, as well as
59+
`ServiceBuilder::buffer` to avoid any deadlocks in message handling in `Connection`
60+
due to the limited concurrency.
6161

6262
3. At the highest level of complexity, application developers can implement
63-
multiple distinct `Service`s and manually control synchronization of shared
64-
state between them, then use these to construct the ABCI `Server`.
63+
multiple distinct `Service`s and manually control synchronization of shared
64+
state between them, then use these to construct the ABCI `Server`.
6565

6666
Because these use the same interfaces in different ways, application
6767
developers can move gradually along this curve according to their performance

0 commit comments

Comments
 (0)