A citizen portal must wait for a function’s response body before rendering the next page. Which OCI Functions invoke type should the portal use?
Select an answer to reveal the explanation.
Short Explanation
Sync invoke is a phone call that stays on the line until the answer comes back. Detached hangs up once work has started and lets the function finish without holding the HTTP client.
Full Explanation
When a citizen portal must wait for a function’s response body before rendering the next page, use synchronous (sync) invoke: it runs the function and returns the result to the caller. Sync keeps the HTTP client on the line until the handler finishes (within timeout), which matches UI flows that need the body to continue. Detached is the alternate invoke type when the caller should not block.
Detached invoke only, which never returns a result path, fails by concept for this portal because detached returns as soon as processing has begun and leaves result handling to the function—exactly wrong when the page needs the response body now. Substituting OCI Queue put-message for Functions invoke types fails because Queue is a messaging service with different semantics, not a Functions invoke-type replacement. Streaming produce-call with a five-day retention override fails because Streaming solves event streaming/retention problems, not the sync-versus-detached Functions invoke choice.
Exam caveat: sync is still bounded by the sync timeout ceiling; long portal work may need redesign (async UX plus detached or another compute model), not an unlimited sync hold. Operational check: invoke the portal’s function with sync, measure time-to-body, set timeout near real need, and confirm the UI only advances after a successful response payload.