| 308 | } |
| 309 | |
| 310 | void ComputeAsync(OpKernelContext* ctx, |
| 311 | AsyncOpKernel::DoneCallback done) override { |
| 312 | WorkQueue* work_queue; |
| 313 | OP_REQUIRES_OK(ctx, |
| 314 | LookupResource(ctx, HandleFromInput(ctx, 0), &work_queue)); |
| 315 | core::ScopedUnref scoped_list(work_queue); |
| 316 | work_queue->Schedule(num_clients_, [this, ctx, done, work_queue]() { |
| 317 | Tensor* work; |
| 318 | OP_REQUIRES_OK_ASYNC(ctx, ctx->allocate_output(0, TensorShape({}), &work), |
| 319 | done); |
| 320 | OP_REQUIRES_OK_ASYNC(ctx, work_queue->Take(work), done); |
| 321 | done(); |
| 322 | }); |
| 323 | } |
| 324 | |
| 325 | private: |
| 326 | int64 num_clients_; |
nothing calls this directly
no test coverage detected