* Asynchronously request a tuple from a designed async-capable node. */
| 23 | * Asynchronously request a tuple from a designed async-capable node. |
| 24 | */ |
| 25 | void |
| 26 | ExecAsyncRequest(AsyncRequest *areq) |
| 27 | { |
| 28 | if (areq->requestee->chgParam != NULL) /* something changed? */ |
| 29 | ExecReScan(areq->requestee); /* let ReScan handle this */ |
| 30 | |
| 31 | /* must provide our own instrumentation support */ |
| 32 | if (areq->requestee->instrument) |
| 33 | InstrStartNode(areq->requestee->instrument); |
| 34 | |
| 35 | switch (nodeTag(areq->requestee)) |
| 36 | { |
| 37 | case T_ForeignScanState: |
| 38 | ExecAsyncForeignScanRequest(areq); |
| 39 | break; |
| 40 | default: |
| 41 | /* If the node doesn't support async, caller messed up. */ |
| 42 | elog(ERROR, "unrecognized node type: %d", |
| 43 | (int) nodeTag(areq->requestee)); |
| 44 | } |
| 45 | |
| 46 | ExecAsyncResponse(areq); |
| 47 | |
| 48 | /* must provide our own instrumentation support */ |
| 49 | if (areq->requestee->instrument) |
| 50 | InstrStopNode(areq->requestee->instrument, |
| 51 | TupIsNull(areq->result) ? 0.0 : 1.0); |
| 52 | } |
| 53 | |
| 54 | /* |
| 55 | * Give the asynchronous node a chance to configure the file descriptor event |
no test coverage detected