Implements Closure which encloses RPC stuff
| 39 | |
| 40 | // Implements Closure which encloses RPC stuff |
| 41 | class BlockClosure : public braft::Closure { |
| 42 | public: |
| 43 | BlockClosure(Block* block, |
| 44 | const BlockRequest* request, |
| 45 | BlockResponse* response, |
| 46 | butil::IOBuf* data, |
| 47 | google::protobuf::Closure* done) |
| 48 | : _block(block) |
| 49 | , _request(request) |
| 50 | , _response(response) |
| 51 | , _data(data) |
| 52 | , _done(done) {} |
| 53 | ~BlockClosure() {} |
| 54 | |
| 55 | const BlockRequest* request() const { return _request; } |
| 56 | BlockResponse* response() const { return _response; } |
| 57 | void Run(); |
| 58 | butil::IOBuf* data() const { return _data; } |
| 59 | |
| 60 | private: |
| 61 | // Disable explicitly delete |
| 62 | Block* _block; |
| 63 | const BlockRequest* _request; |
| 64 | BlockResponse* _response; |
| 65 | butil::IOBuf* _data; |
| 66 | google::protobuf::Closure* _done; |
| 67 | }; |
| 68 | |
| 69 | // Implementation of example::Block as a braft::StateMachine. |
| 70 | class Block : public braft::StateMachine { |
nothing calls this directly
no outgoing calls
no test coverage detected