statemachine.go ×6

Frontier kind: Code frontier

unlabeled · c_4f30ea62a136

18 tests · 2873 LOC · 132 files · introduces 0 tests · 17 LOC · 1 file

Introduces — evidence that enters the hierarchy at this concept

Code
6 ranges17 lines · 1 files
Tests
0 tests

Contains — complete concept membership

All code (extent)
477 ranges2873 lines · 132 files · Browse complete extent
All tests (intent)
18 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.

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 6 ranges. Expand a file to inspect source; the > gutter marks introduced lines.

go.temporal.io/server/components/nexusoperations/statemachine.go 17 introduced LOC · 6 ranges

Open complete file

531 }
532
533 > func (c Cancelation) SetState(state enumspb.NexusOperationCancellationState) { statemachine.go
534 > c.NexusOperationCancellationInfo.State = state
535 > }
536
537 func (c Cancelation) recordAttempt(ts time.Time) {
541 }
542
543 > func (c Cancelation) RegenerateTasks(node *hsm.Node) ([]hsm.Task, error) { statemachine.go
544 > op, err := hsm.MachineData[Operation](node.Parent)
545 > if err != nil {
546 return nil, err
547 }
548 > switch c.State() { // nolint:exhaustive statemachine.go
549 > case enumspb.NEXUS_OPERATION_CANCELLATION_STATE_SCHEDULED:
550 > return []hsm.Task{CancelationTask{EndpointName: op.Endpoint, Attempt: c.Attempt}}, nil
551 case enumspb.NEXUS_OPERATION_CANCELLATION_STATE_BACKING_OFF:
552 return []hsm.Task{CancelationBackoffTask{deadline: c.NextAttemptScheduleTime.AsTime()}}, nil
556 }
557
558 > func (c Cancelation) output(node *hsm.Node) (hsm.TransitionOutput, error) { statemachine.go
559 > tasks, err := c.RegenerateTasks(node)
560 > if err != nil {
561 return hsm.TransitionOutput{}, err
562 }
563 > return hsm.TransitionOutput{Tasks: tasks}, nil statemachine.go
564 }
565
595 []enumspb.NexusOperationCancellationState{enumspb.NEXUS_OPERATION_CANCELLATION_STATE_UNSPECIFIED},
596 enumspb.NEXUS_OPERATION_CANCELLATION_STATE_SCHEDULED,
597 > func(op Cancelation, event EventCancelationScheduled) (hsm.TransitionOutput, error) { statemachine.go
598 > op.RequestedTime = timestamppb.New(event.Time)
599 > return op.output(event.Node)
600 > },
601 )
602