| 503 | // |
| 504 | void fetch_current_handler(rpc_response_handler &cb) { cb = std::move(_cb); } |
| 505 | void replace_callback(rpc_response_handler &&cb) |
| 506 | { |
| 507 | task_state cur_state = state(); |
| 508 | CHECK(cur_state == TASK_STATE_READY || cur_state == TASK_STATE_RUNNING, |
| 509 | "invalid task_state: {}", |
| 510 | enum_to_string(cur_state)); |
| 511 | _cb = std::move(cb); |
| 512 | } |
| 513 | void replace_callback(const rpc_response_handler &cb) |
| 514 | { |
| 515 | replace_callback(rpc_response_handler(cb)); |