* Call the asynchronous node back when a relevant event has occurred. */
| 85 | * Call the asynchronous node back when a relevant event has occurred. |
| 86 | */ |
| 87 | void |
| 88 | ExecAsyncNotify(AsyncRequest *areq) |
| 89 | { |
| 90 | /* must provide our own instrumentation support */ |
| 91 | if (areq->requestee->instrument) |
| 92 | InstrStartNode(areq->requestee->instrument); |
| 93 | |
| 94 | switch (nodeTag(areq->requestee)) |
| 95 | { |
| 96 | case T_ForeignScanState: |
| 97 | ExecAsyncForeignScanNotify(areq); |
| 98 | break; |
| 99 | default: |
| 100 | /* If the node doesn't support async, caller messed up. */ |
| 101 | elog(ERROR, "unrecognized node type: %d", |
| 102 | (int) nodeTag(areq->requestee)); |
| 103 | } |
| 104 | |
| 105 | ExecAsyncResponse(areq); |
| 106 | |
| 107 | /* must provide our own instrumentation support */ |
| 108 | if (areq->requestee->instrument) |
| 109 | InstrStopNode(areq->requestee->instrument, |
| 110 | TupIsNull(areq->result) ? 0.0 : 1.0); |
| 111 | } |
| 112 | |
| 113 | /* |
| 114 | * Call the requestor back when an asynchronous node has produced a result. |
no test coverage detected