pri_task_reader.go ×5

Frontier kind: Code frontier

unlabeled · c_10a1d4e3d10b

18 tests · 3624 LOC · 153 files · introduces 0 tests · 19 LOC · 1 file

Introduces — evidence that enters the hierarchy at this concept

Code
5 ranges19 lines · 1 files
Tests
0 tests

Contains — complete concept membership

All code (extent)
610 ranges3624 lines · 153 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: 19 introduced LOC across 5 ranges. Expand a file to inspect source; the > gutter marks introduced lines.

go.temporal.io/server/service/matching/pri_task_reader.go 19 introduced LOC · 5 ranges

Open complete file

194 }
195
196 > tr.processTaskBatch(batch.tasks) pri_task_reader.go
197 > // There may be more tasks.
198 > tr.SignalTaskLoading()
199 }
200 }
232 // return as long as it grabs any tasks
233 if len(response.Tasks) > 0 {
234 > return getTasksBatchResponse{tasks: response.Tasks}, nil pri_task_reader.go
235 > }
236 readLevel = upper
237 }
243 }
244
245 > func (tr *priTaskReader) processTaskBatch(tasks []*persistencespb.AllocatedTaskInfo) { pri_task_reader.go
246 > tr.lock.Lock()
247 >
248 > tasks = slices.DeleteFunc(tasks, func(t *persistencespb.AllocatedTaskInfo) bool {
249 > tr.readLevel = max(tr.readLevel, t.TaskId)
250 >
251 > if IsTaskExpired(t) {
252 // task expired when we read it
253 recordDroppedTask(tr.backlogMgr.metricsHandler, dropReasonExpiredRead)
258 // tasks twice. In that case, we should just ignore them. If we win (based on
259 // readLevel), signalNewTasks will give up and signal us.
260 > _, found := tr.outstandingTasks.Get(t.TaskId) pri_task_reader.go
261 > return found
262 })
263
264 > tr.recordNewTasksLocked(tasks) pri_task_reader.go
265 >
266 > tr.lock.Unlock()
267 >
268 > tr.addNewTasks(tasks)
269 }
270