ack_manager.go ×5

Frontier kind: Code frontier

unlabeled · c_7e648501c7fc

53 tests · 3168 LOC · 144 files · introduces 0 tests · 20 LOC · 1 file

Introduces — evidence that enters the hierarchy at this concept

Code
5 ranges20 lines · 1 files
Tests
0 tests

Contains — complete concept membership

All code (extent)
489 ranges3168 lines · 144 files · Browse complete extent
All tests (intent)
53 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: 20 introduced LOC across 5 ranges. Expand a file to inspect source; the > gutter marks introduced lines.

go.temporal.io/server/service/matching/ack_manager.go 20 introduced LOC · 5 ranges

Open complete file

95 }
96
97 > func (m *ackManager) completeTask(taskID int64) (newAckLevel, numberOfAckedTasks int64) { ack_manager.go
98 > m.Lock()
99 > defer m.Unlock()
100 >
101 > macked, found := m.outstandingTasks.Get(taskID)
102 > if !found {
103 return m.ackLevel, 0
104 }
105
106 > acked := macked.(bool) ack_manager.go
107 > if acked {
108 // don't adjust ack level if nothing has changed
109 return m.ackLevel, 0
112 // TODO the ack level management should be done by a dedicated coroutine
113 // this is only a temporarily solution
114 > m.outstandingTasks.Put(taskID, true) ack_manager.go
115 > m.backlogCountHint.Add(-1)
116 >
117 > // Adjust the ack level as far as we can
118 > for {
119 > min, acked := m.outstandingTasks.Min()
120 > if min == nil || !acked.(bool) {
121 > break
122 }
123 > m.ackLevel = min.(int64) ack_manager.go
124 > m.outstandingTasks.Remove(min)
125 > numberOfAckedTasks += 1
126 }
127 > return m.ackLevel, numberOfAckedTasks ack_manager.go
128 }
129