activities.go ×7

Frontier kind: Code frontier

unlabeled · c_b904582dae63

2 tests · 2371 LOC · 115 files · introduces 0 tests · 25 LOC · 1 file

Introduces — evidence that enters the hierarchy at this concept

Code
7 ranges25 lines · 1 files
Tests
0 tests

Contains — complete concept membership

All code (extent)
373 ranges2371 lines · 115 files · Browse complete extent
All tests (intent)
2 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: 25 introduced LOC across 7 ranges. Expand a file to inspect source; the > gutter marks introduced lines.

go.temporal.io/server/service/worker/batcher/activities.go 25 introduced LOC · 7 ranges

Open complete file

112
113 // allSubmitted returns true if all executions in this page have been submitted
114 > func (p *page) allSubmitted() bool { activities.go
115 > return p.submittedCount == p.length()
116 > }
117
118 // nextTask returns the next task to be submitted from this page
161 pageToken []byte,
162 pageNumber int,
163 > ) (*page, error) { activities.go
164 > if len(config.adjustedQuery) == 0 {
165 // No query provided, return empty page
166 return &page{
173 // Terminate/Cancel/Delete Activities batch types operate on activity executions,
174 // so they are listed via ListActivityExecutions; all other batch types list workflow executions.
175 > var executionInfos []*workflowpb.WorkflowExecutionInfo activities.go
176 > var targetExecutionInfo []*commonpb.Execution
177 > var nextPageToken []byte
178 > if isActivityBatchType(config.batchType) {
179 resp, err := sdkClient.WorkflowService().ListActivityExecutions(ctx,
180 &workflowservice.ListActivityExecutionsRequest{
220 }
221
222 > return &page{ activities.go
223 > executionInfos: executionInfos,
224 > targetExecutionInfo: targetExecutionInfo,
225 > nextPageToken: nextPageToken,
226 > pageNumber: pageNumber,
227 > }, nil
228 }
229
310 }
311 }
312 > } else { activities.go
313 > // Fetch page of executions if needed
314 > var err error
315 > p, err = fetchPage(ctx, sdkClient, config, config.initialPageToken, hbd.CurrentPage)
316 > if err != nil {
317 metrics.BatcherOperationFailures.With(metricsHandler).Record(1)
318 return HeartBeatDetails{}, fmt.Errorf("failed to fetch next page: %w", err)
323 // Check if we need to fetch next page
324 if p.hasNext() && p.allSubmitted() {
325 > nextPage, err := fetchPage(ctx, sdkClient, config, p.nextPageToken, p.pageNumber+1) activities.go
326 > if err != nil {
327 metrics.BatcherOperationFailures.With(metricsHandler).Record(1)
328 return HeartBeatDetails{}, fmt.Errorf("failed to fetch next page: %w", err)
329 }
330 > p.next = nextPage activities.go
331 > nextPage.prev = p
332 > p = nextPage
333 }
334