| 423 | friend class brpc::IOEvent<EventPipe>; |
| 424 | |
| 425 | int OnCreated() { |
| 426 | if (pipe(_pipe_fds)) { |
| 427 | PLOG(FATAL) << "Fail to create _pipe_fds"; |
| 428 | return -1; |
| 429 | } |
| 430 | if (_io_event.Init((void*)id()) != 0) { |
| 431 | LOG(ERROR) << "Fail to init IOEvent"; |
| 432 | return -1; |
| 433 | } |
| 434 | _io_event.set_bthread_tag(bthread_self_tag()); |
| 435 | if (_io_event.AddConsumer(_pipe_fds[0]) != 0) { |
| 436 | PLOG(ERROR) << "Fail to add SocketId=" << id() |
| 437 | << " into EventDispatcher"; |
| 438 | return -1; |
| 439 | } |
| 440 | |
| 441 | |
| 442 | _input_event_count = 0; |
| 443 | return 0; |
| 444 | } |
| 445 | |
| 446 | void BeforeRecycled() { |
| 447 | brpc::GetGlobalEventDispatcher(_pipe_fds[0], bthread_self_tag()) |
nothing calls this directly
no test coverage detected