tasks.go ×12

Frontier kind: Joint frontier

unlabeled · c_efe8676c6e13

1 test · 3544 LOC · 149 files · introduces 1 test · 59 LOC · 5 files

Introduces — evidence that enters the hierarchy at this concept

Code
19 ranges59 lines · 5 files
Tests
1 test

Contains — complete concept membership

All code (extent)
654 ranges3544 lines · 149 files · Browse complete extent
All tests (intent)
1 testBrowse 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.

1 test introduced at this concept.

Introduced code

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

5 files ranked by introduced lines: 59 introduced LOC across 19 ranges. Expand a file to inspect source; the > gutter marks introduced lines.

go.temporal.io/server/components/nexusoperations/tasks.go 28 introduced LOC · 12 ranges

Open complete file

39 }
40
41 > func (t ScheduleToCloseTimeoutTask) Deadline() time.Time { tasks.go
42 > return t.deadline
43 > }
44
45 > func (ScheduleToCloseTimeoutTask) Destination() string { tasks.go
46 > return ""
47 > }
48
49 // Validate checks if the timeout task is still valid to execute for the given node state.
50 > func (t ScheduleToCloseTimeoutTask) Validate(ref *persistencespb.StateMachineRef, node *hsm.Node) error { tasks.go
51 > if err := node.CheckRunning(); err != nil {
52 return err
53 }
54 > op, err := hsm.MachineData[Operation](node) tasks.go
55 > if err != nil {
56 return err
57 }
58 > if !TransitionTimedOut.Possible(op) { tasks.go
59 return fmt.Errorf(
60 "%w: %w: cannot timeout machine in state %v",
64 )
65 }
66 > return nil tasks.go
67 }
68
73 }
74
75 > func (TimeoutTaskSerializer) Serialize(hsm.Task) ([]byte, error) { tasks.go
76 > return nil, nil
77 > }
78
79 type InvocationTask struct {
88 }
89
90 > func (InvocationTask) Deadline() time.Time { tasks.go
91 > return hsm.Immediate
92 > }
93
94 > func (t InvocationTask) Destination() string { tasks.go
95 > return t.EndpointName
96 > }
97
98 > func (InvocationTask) Validate(ref *persistencespb.StateMachineRef, node *hsm.Node) error { tasks.go
99 > if err := node.CheckRunning(); err != nil {
100 return err
101 }
102 > return hsm.ValidateState[enumsspb.NexusOperationState, Operation](node, enumsspb.NEXUS_OPERATION_STATE_SCHEDULED) tasks.go
103 }
104
114 }
115
116 > func (InvocationTaskSerializer) Serialize(task hsm.Task) ([]byte, error) { tasks.go
117 > switch task := task.(type) {
118 > case InvocationTask:
119 > return proto.Marshal(&persistencespb.NexusInvocationTaskInfo{Attempt: task.Attempt})
120 default:
121 return nil, serviceerror.NewInternalf("unknown HSM task type while serializing: %v", task)
go.temporal.io/server/service/history/interfaces/mutable_state_mock.go 10 introduced LOC · 2 ranges

Open complete file

1912
1913 // CurrentVersionedTransition mocks base method.
1914 > func (m *MockMutableState) CurrentVersionedTransition() *persistence.VersionedTransition { mutable_state_mock.go
1915 > m.ctrl.T.Helper()
1916 > ret := m.ctrl.Call(m, "CurrentVersionedTransition")
1917 > ret0, _ := ret[0].(*persistence.VersionedTransition)
1918 > return ret0
1919 > }
1920
1921 // CurrentVersionedTransition indicates an expected call of CurrentVersionedTransition.
1922 > func (mr *MockMutableStateMockRecorder) CurrentVersionedTransition() *gomock.Call { mutable_state_mock.go
1923 > mr.mock.ctrl.T.Helper()
1924 > return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CurrentVersionedTransition", reflect.TypeOf((*MockMutableState)(nil).CurrentVersionedTransition))
1925 > }
1926
1927 // DeleteCHASMPureTasks mocks base method.
go.temporal.io/server/components/callbacks/tasks.go 9 introduced LOC · 3 ranges

Open complete file

66 }
67
68 > func (BackoffTask) Destination() string { tasks.go
69 > return ""
70 > }
71
72 > func (BackoffTask) Validate(ref *persistencespb.StateMachineRef, node *hsm.Node) error { tasks.go
73 > return hsm.ValidateState[enumsspb.CallbackState, Callback](node, enumsspb.CALLBACK_STATE_BACKING_OFF)
74 > }
75
76 type BackoffTaskSerializer struct{}
80 }
81
82 > func (BackoffTaskSerializer) Serialize(hsm.Task) ([]byte, error) { tasks.go
83 > return nil, nil
84 > }
85
86 func RegisterTaskSerializers(reg *hsm.Registry) error {
go.temporal.io/server/api/persistence/v1/executions.pb.go 8 introduced LOC · 1 range

Open complete file

2695 func (*NexusInvocationTaskInfo) ProtoMessage() {}
2696
2697 > func (x *NexusInvocationTaskInfo) ProtoReflect() protoreflect.Message { executions.pb.go
2698 > mi := &file_temporal_server_api_persistence_v1_executions_proto_msgTypes[15]
2699 > if x != nil {
2700 > ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
2701 > if ms.LoadMessageInfo() == nil {
2702 > ms.StoreMessageInfo(mi)
2703 > }
2704 > return ms
2705 }
2706 return mi.MessageOf(x)
go.temporal.io/server/service/history/hsm/tree.go 4 introduced LOC · 1 range

Open complete file

501 execution, err := MachineData[interface{ IsWorkflowExecutionRunning() bool }](root)
502 if err != nil {
503 > if errors.Is(err, ErrIncompatibleType) { tree.go
504 > // The machine is not attached to a workflow. It is currently assumed to be running.
505 > return nil
506 > }
507 return err
508 }