completion.go ×7

Frontier kind: Code frontier

unlabeled · c_c27109a66194

5 tests · 66 LOC · 2 files · introduces 0 tests · 17 LOC · 1 file

Introduces — evidence that enters the hierarchy at this concept

Code
7 ranges17 lines · 1 files
Tests
0 tests

Contains — complete concept membership

All code (extent)
30 ranges66 lines · 2 files · Browse complete extent
All tests (intent)
5 testsBrowse complete intent

Neighbourhood graph

The orange circle is the focus. Violet and green circles are every ancestor and descendant, broader and narrower, at any distance; blue squares and pink diamonds are the introduced files and exact introduced tests of every visible concept, not only the focus's. Arrows point from broader to narrower concepts and bridge only concepts omitted from this view. Undirected links show source or test introduction. Concept and file size follows LOC; exact test nodes use test-count units.

Introduced files, introduced tests, and structurally relevant concept specialization

In the embedded map, ordinary wheel input scrolls the page; use the visible controls to zoom and drag to pan. Open the full-screen map for canvas navigation: wheel pans, Ctrl/Command plus wheel zooms, and arrow keys pan when this region is focused. On touch screens, open the full-screen map to pan or pinch. If JavaScript or WebGL is unavailable, use the native relationship evidence on this page.

Introduced files, introduced tests, and structurally relevant concept specializationcompletion.go ×1 · 3 introduced LOCcompletion.go ×1completion.go ×1 · 7 introduced LOCcompletion.go ×1TestSuccessfulCompletion · 0 introduced LOCTestSuccessfulCompletioncompletion.go ×9 · 19 introduced LOCcompletion.go ×9completion.go ×1 · 2 introduced LOCcompletion.go ×1TestSuccessfulCompletion_CustomSerializer · 0 introduced LOCTestSuccessfulCompletion…completion.go ×5 · 10 introduced LOCcompletion.go ×5completion.go ×1 · 2 introduced LOCcompletion.go ×1completion.go ×1 · 8 introduced LOCcompletion.go ×1completion.go ×2 · 4 introduced LOCcompletion.go ×2completion.go ×1 · 1 introduced LOCcompletion.go ×1completion.go ×15 · 30 introduced LOCcompletion.go ×15completion.go ×4 · 11 introduced LOCcompletion.go ×4api.go ×1 · 1 introduced LOCapi.go ×1api.go ×1 · 2 introduced LOCapi.go ×1api.go ×1 · 4 introduced LOCapi.go ×1TestOperatorServiceMetadata, TestWorkflowServiceMetadata · 0 introduced LOCTestOperatorServiceMetad…go.temporal.io/server/common/nexus/nexusrpc/api.go · 295 LOCnexusrpc/api.gogo.temporal.io/server/common/nexus/nexusrpc/completion.go · 327 LOCnexusrpc/completion.goTestOperatorServiceMetadata · introduced test · go.temporal.io/server/common/api/TestOperatorServiceMetadataTestOperatorServiceMetad…TestWorkflowServiceMetadata · introduced test · go.temporal.io/server/common/api/TestWorkflowServiceMetadataTestWorkflowServiceMetad…TestBadRequestCompletion · introduced test · go.temporal.io/server/common/nexus/nexusrpc/TestBadRequestCompletionTestBadRequestCompletionTestFailureCompletion · introduced test · go.temporal.io/server/common/nexus/nexusrpc/TestFailureCompletionTestFailureCompletionTestFailureCompletion_CustomFailureConverter · introduced test · go.temporal.io/server/common/nexus/nexusrpc/TestFailureCompletion_CustomFailureConverterTestFailureCompletion_Cu…TestSuccessfulCompletion · introduced test · go.temporal.io/server/common/nexus/nexusrpc/TestSuccessfulCompletionTestSuccessfulCompletionTestSuccessfulCompletion_CustomSerializer · introduced test · go.temporal.io/server/common/nexus/nexusrpc/TestSuccessfulCompletion_CustomSerializerTestSuccessfulCompletion…Focused concept · completion.go ×7 · 17 introduced LOCcompletion.go ×7

Graph controls are ready.

Interactive rendering requires JavaScript and WebGL. Use the native relationship evidence on this page while the interactive map is unavailable.

Native relationship evidence

Every exact file and test below is linked only from the concept that introduces it.

Introduced tests

Every collected test enters the hierarchy at exactly one concept.

No tests are introduced at this concept. Its intent tests are introduced by other concepts.

Introduced code

Every collected source range enters the hierarchy at exactly one concept.

1 file ranked by introduced lines: 17 introduced LOC across 7 ranges. Expand a file to inspect source; the > gutter marks introduced lines.

go.temporal.io/server/common/nexus/nexusrpc/completion.go 17 introduced LOC · 7 ranges

Open complete file

35 func NewCompletionHTTPClient(options CompletionHTTPClientOptions) *CompletionHTTPClient {
36 if options.HTTPCaller == nil {
37 > options.HTTPCaller = http.DefaultClient.Do completion.go
38 > }
39 if options.Serializer == nil {
40 options.Serializer = nexus.DefaultSerializer()
228 }
229
230 > func (h *completionHTTPHandler) ServeHTTP(writer http.ResponseWriter, request *http.Request) { completion.go
231 > ctx := request.Context()
232 > completion := CompletionRequest{
233 > State: nexus.OperationState(request.Header.Get(headerOperationState)),
234 > OperationToken: request.Header.Get(nexus.HeaderOperationToken),
235 > HTTPRequest: request,
236 > }
237 > if startTimeHeader := request.Header.Get(headerOperationStartTime); startTimeHeader != "" {
238 var parseTimeErr error
239 if completion.StartTime, parseTimeErr = http.ParseTime(startTimeHeader); parseTimeErr != nil {
242 }
243 }
244 > if closeTimeHeader := request.Header.Get(headerOperationCloseTime); closeTimeHeader != "" { completion.go
245 var parseTimeErr error
246 if completion.CloseTime, parseTimeErr = unmarshalTimestamp(closeTimeHeader); parseTimeErr != nil {
249 }
250 }
251 > var decodeErr error completion.go
252 > if completion.Links, decodeErr = getLinksFromHeader(request.Header); decodeErr != nil {
253 h.WriteFailure(writer, request, nexus.NewHandlerErrorf(nexus.HandlerErrorTypeBadRequest, "failed to decode links from request headers"))
254 return
255 }
256 > switch completion.State { completion.go
257 case nexus.OperationStateFailed, nexus.OperationStateCanceled:
258 if !isMediaTypeJSON(request.Header.Get("Content-Type")) {
302 return
303 }
304 > if err := h.options.Handler.CompleteOperation(ctx, &completion); err != nil { completion.go
305 h.WriteFailure(writer, request, err)
306 }
310 func NewCompletionHTTPHandler(options CompletionHandlerOptions) http.Handler {
311 if options.Logger == nil {
312 > options.Logger = slog.Default() completion.go
313 > }
314 if options.Serializer == nil {
315 options.Serializer = nexus.DefaultSerializer()