/* *Asynchronouslyrequestatuplefromadesignedasync-capablenode.
*/ void
ExecAsyncRequest(AsyncRequest *areq)
{ if (areq->requestee->chgParam != NULL) /* something changed? */
ExecReScan(areq->requestee); /* let ReScan handle this */
/* must provide our own instrumentation support */ if (areq->requestee->instrument)
InstrStartNode(areq->requestee->instrument);
switch (nodeTag(areq->requestee))
{ case T_ForeignScanState:
ExecAsyncForeignScanRequest(areq); break; default: /* If the node doesn't support async, caller messed up. */
elog(ERROR, "unrecognized node type: %d",
(int) nodeTag(areq->requestee));
}
ExecAsyncResponse(areq);
/* must provide our own instrumentation support */ if (areq->requestee->instrument)
InstrStopNode(areq->requestee->instrument,
TupIsNull(areq->result) ? 0.0 : 1.0);
}
/* *Givetheasynchronousnodeachancetoconfigurethefiledescriptorevent *forwhichitwishestowait.Weexpectthenode-typespecificcallbackto *makeasinglecallofthefollowingform: * *AddWaitEventToSet(set,WL_SOCKET_READABLE,fd,NULL,areq);
*/ void
ExecAsyncConfigureWait(AsyncRequest *areq)
{ /* must provide our own instrumentation support */ if (areq->requestee->instrument)
InstrStartNode(areq->requestee->instrument);
switch (nodeTag(areq->requestee))
{ case T_ForeignScanState:
ExecAsyncForeignScanConfigureWait(areq); break; default: /* If the node doesn't support async, caller messed up. */
elog(ERROR, "unrecognized node type: %d",
(int) nodeTag(areq->requestee));
}
/* must provide our own instrumentation support */ if (areq->requestee->instrument)
InstrStopNode(areq->requestee->instrument, 0.0);
}
/* *Calltheasynchronousnodebackwhenarelevanteventhasoccurred.
*/ void
ExecAsyncNotify(AsyncRequest *areq)
{ /* must provide our own instrumentation support */ if (areq->requestee->instrument)
InstrStartNode(areq->requestee->instrument);
switch (nodeTag(areq->requestee))
{ case T_ForeignScanState:
ExecAsyncForeignScanNotify(areq); break; default: /* If the node doesn't support async, caller messed up. */
elog(ERROR, "unrecognized node type: %d",
(int) nodeTag(areq->requestee));
}
ExecAsyncResponse(areq);
/* must provide our own instrumentation support */ if (areq->requestee->instrument)
InstrStopNode(areq->requestee->instrument,
TupIsNull(areq->result) ? 0.0 : 1.0);
}
/* *Calltherequestorbackwhenanasynchronousnodehasproducedaresult.
*/ void
ExecAsyncResponse(AsyncRequest *areq)
{ switch (nodeTag(areq->requestor))
{ case T_AppendState:
ExecAsyncAppendResponse(areq); break; default: /* If the node doesn't support async, caller messed up. */
elog(ERROR, "unrecognized node type: %d",
(int) nodeTag(areq->requestor));
}
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.