| 181 | ~State() {} |
| 182 | |
| 183 | void Start() { |
| 184 | FHandle handle = cond_ ? then_handle_ : else_handle_; |
| 185 | rets_.clear(); |
| 186 | profiler::TraceMe trace_me( |
| 187 | [&] { |
| 188 | return absl::StrCat("IfOp #parent_step_id=", ctx_->step_id(), |
| 189 | ",function_step_id=", opts_.step_id, "#"); |
| 190 | }, |
| 191 | /*level=*/2); |
| 192 | lib_->Run( |
| 193 | // Evaluate one of the branch. |
| 194 | opts_, handle, args_, &rets_, |
| 195 | // Done callback |
| 196 | [this](Status s) { |
| 197 | if (s.ok()) { |
| 198 | s = SetOutputs(kernel_, ctx_, rets_); |
| 199 | } |
| 200 | ctx_->SetStatus(s); |
| 201 | DoneCallback captured_done(std::move(done_)); |
| 202 | delete this; |
| 203 | captured_done(); |
| 204 | }); |
| 205 | } |
| 206 | |
| 207 | private: |
| 208 | IfOp* const kernel_; |
no test coverage detected