File tree Expand file tree Collapse file tree 2 files changed +23
-0
lines changed
mithril-aggregator/src/services Expand file tree Collapse file tree 2 files changed +23
-0
lines changed Original file line number Diff line number Diff line change @@ -16,6 +16,8 @@ mod epoch_service;
16
16
mod message;
17
17
mod prover;
18
18
mod signable_builder;
19
+ mod signature_consumer;
20
+ mod signature_processor;
19
21
mod signed_entity;
20
22
mod signer_registration;
21
23
mod snapshotter;
@@ -30,6 +32,8 @@ pub use epoch_service::*;
30
32
pub use message:: * ;
31
33
pub use prover:: * ;
32
34
pub use signable_builder:: * ;
35
+ pub use signature_consumer:: * ;
36
+ pub use signature_processor:: * ;
33
37
pub use signed_entity:: * ;
34
38
pub use signer_registration:: * ;
35
39
pub use snapshotter:: * ;
Original file line number Diff line number Diff line change
1
+ use mithril_common:: StdResult ;
2
+
3
+ /// A signature processor which receives signature and processes them.
4
+ #[ cfg_attr( test, mockall:: automock) ]
5
+ #[ async_trait:: async_trait]
6
+ pub trait SignatureProcessor : Sync + Send {
7
+ /// Processes the signatures received from the consumer.
8
+ async fn process_signatures ( & self ) -> StdResult < ( ) > ;
9
+
10
+ /// Starts the processor, which will run indefinitely, processing signatures as they arrive.
11
+ async fn run ( & self ) -> StdResult < ( ) > {
12
+ loop {
13
+ self . process_signatures ( ) . await ?;
14
+ }
15
+ }
16
+
17
+ /// Stops the processor. This method should be called to gracefully shut down the processor.
18
+ async fn stop ( & self ) -> StdResult < ( ) > ;
19
+ }
You can’t perform that action at this time.
0 commit comments