Implements example::BlockService if you are using brpc.
| 440 | |
| 441 | // Implements example::BlockService if you are using brpc. |
| 442 | class BlockServiceImpl : public BlockService { |
| 443 | public: |
| 444 | explicit BlockServiceImpl(Block* block) : _block(block) {} |
| 445 | void write(::google::protobuf::RpcController* controller, |
| 446 | const ::example::BlockRequest* request, |
| 447 | ::example::BlockResponse* response, |
| 448 | ::google::protobuf::Closure* done) { |
| 449 | brpc::Controller* cntl = (brpc::Controller*)controller; |
| 450 | return _block->write(request, response, |
| 451 | &cntl->request_attachment(), done); |
| 452 | } |
| 453 | void read(::google::protobuf::RpcController* controller, |
| 454 | const ::example::BlockRequest* request, |
| 455 | ::example::BlockResponse* response, |
| 456 | ::google::protobuf::Closure* done) { |
| 457 | brpc::Controller* cntl = (brpc::Controller*)controller; |
| 458 | brpc::ClosureGuard done_guard(done); |
| 459 | return _block->read(request, response, &cntl->response_attachment()); |
| 460 | } |
| 461 | private: |
| 462 | Block* _block; |
| 463 | }; |
| 464 | |
| 465 | } // namespace example |
| 466 |
nothing calls this directly
no outgoing calls
no test coverage detected