matching_engine.go ×4

Frontier kind: Code frontier

unlabeled · c_ed6d18a8022f

9 tests · 3359 LOC · 155 files · introduces 0 tests · 41 LOC · 3 files

Introduces — evidence that enters the hierarchy at this concept

Code
8 ranges41 lines · 3 files
Tests
0 tests

Contains — complete concept membership

All code (extent)
555 ranges3359 lines · 155 files · Browse complete extent
All tests (intent)
9 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.

3 files ranked by introduced lines: 41 introduced LOC across 8 ranges. Expand a file to inspect source; the > gutter marks introduced lines.

go.temporal.io/server/service/matching/matching_engine.go 22 introduced LOC · 4 ranges

Open complete file

2641 }
2642
2643 > func (e *matchingEngineImpl) DispatchNexusTask(ctx context.Context, request *matchingservice.DispatchNexusTaskRequest) (*matchingservice.DispatchNexusTaskResponse, error) { matching_engine.go
2644 > partition, err := tqid.PartitionFromProto(request.GetTaskQueue(), request.GetNamespaceId(), enumspb.TASK_QUEUE_TYPE_NEXUS)
2645 > if err != nil {
2646 return nil, err
2647 }
2648 > pm, _, err := e.getTaskQueuePartitionManager(ctx, partition, true, loadCauseNexusTask) matching_engine.go
2649 > if err != nil {
2650 return nil, err
2651 }
2652
2653 > taskID := uuid.NewString() matching_engine.go
2654 >
2655 > namespaceID := namespace.ID(request.GetNamespaceId())
2656 > ns, err := e.namespaceRegistry.GetNamespaceByID(namespaceID)
2657 > if err != nil {
2658 return nil, err
2659 }
2660
2661 // Buffer the deadline so we can still respond with timeout if we hit the deadline while dispatching
2662 > ctx, cancel := contextutil.WithDeadlineBuffer(ctx, matching.DefaultTimeout, e.config.MinDispatchTaskTimeout(ns.Name().String())) matching_engine.go
2663 > defer cancel()
2664 >
2665 > // First allocate a result channel and register it so that when the task is completed locally (without forwarding) the
2666 > // result can be sent on this channel.
2667 > resultCh := make(chan *nexusResult, 1)
2668 > e.nexusResults.Set(taskID, resultCh)
2669 > defer e.nexusResults.Delete(taskID)
2670 >
2671 > resp, err := pm.DispatchNexusTask(ctx, taskID, request)
2672 >
2673 > if err != nil {
2674 if ctx.Err() != nil {
2675 // The context deadline has expired if it reaches here; return an explicit timeout response to the caller.
go.temporal.io/server/service/matching/task_queue_partition_manager_mock.go 11 introduced LOC · 2 ranges

Open complete file

92
93 // DispatchNexusTask mocks base method.
94 > func (m *MocktaskQueuePartitionManager) DispatchNexusTask(ctx context.Context, taskId string, request *matchingservice.DispatchNexusTaskRequest) (*matchingservice.DispatchNexusTaskResponse, error) { task_queue_partition_manager_mock.go
95 > m.ctrl.T.Helper()
96 > ret := m.ctrl.Call(m, "DispatchNexusTask", ctx, taskId, request)
97 > ret0, _ := ret[0].(*matchingservice.DispatchNexusTaskResponse)
98 > ret1, _ := ret[1].(error)
99 > return ret0, ret1
100 > }
101
102 // DispatchNexusTask indicates an expected call of DispatchNexusTask.
103 > func (mr *MocktaskQueuePartitionManagerMockRecorder) DispatchNexusTask(ctx, taskId, request any) *gomock.Call { task_queue_partition_manager_mock.go
104 > mr.mock.ctrl.T.Helper()
105 > return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DispatchNexusTask", reflect.TypeOf((*MocktaskQueuePartitionManager)(nil).DispatchNexusTask), ctx, taskId, request)
106 > }
107
108 // DispatchQueryTask mocks base method.
go.temporal.io/server/api/matchingservice/v1/request_response.pb.go 8 introduced LOC · 2 ranges

Open complete file

3983 }
3984
3985 > func (x *DispatchNexusTaskRequest) GetNamespaceId() string { request_response.pb.go
3986 > if x != nil {
3987 > return x.NamespaceId
3988 > }
3989 return ""
3990 }
3991
3992 > func (x *DispatchNexusTaskRequest) GetTaskQueue() *v14.TaskQueue { request_response.pb.go
3993 > if x != nil {
3994 > return x.TaskQueue
3995 > }
3996 return nil
3997 }