| 427 | }; |
| 428 | |
| 429 | void BlockClosure::Run() { |
| 430 | // Auto delete this after Run() |
| 431 | std::unique_ptr<BlockClosure> self_guard(this); |
| 432 | // Repsond this RPC. |
| 433 | brpc::ClosureGuard done_guard(_done); |
| 434 | if (status().ok()) { |
| 435 | return; |
| 436 | } |
| 437 | // Try redirect if this request failed. |
| 438 | _block->redirect(_response); |
| 439 | } |
| 440 | |
| 441 | // Implements example::BlockService if you are using brpc. |
| 442 | class BlockServiceImpl : public BlockService { |