batcher.go ×4

Frontier kind: Joint frontier

unlabeled · c_bd16183e92fd

1 test · 211 LOC · 4 files · introduces 1 test · 18 LOC · 2 files

Introduces — evidence that enters the hierarchy at this concept

Code
5 ranges18 lines · 2 files
Tests
1 test

Contains — complete concept membership

All code (extent)
54 ranges211 lines · 4 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.

Introduced files, introduced tests, and structurally relevant concept specializationbatcher.go ×1 · 3 introduced LOCbatcher.go ×1batcher.go ×1 · 3 introduced LOCbatcher.go ×1TestStreamBatcher_MinDelay · 0 introduced LOCTestStreamBatcher_MinDel…batcher.go ×1 · 2 introduced LOCbatcher.go ×1batcher.go ×2 · 4 introduced LOCbatcher.go ×2batcher.go ×9 · 66 introduced LOCbatcher.go ×9context.go ×1 · 5 introduced LOCcontext.go ×1event_time_source.go ×3 · 9 introduced LOCevent_time_source.go ×3event_time_source.go ×1 · 2 introduced LOCevent_time_source.go ×1context.go ×1 · 4 introduced LOCcontext.go ×1context.go ×1 · 7 introduced LOCcontext.go ×1context.go ×1 · 3 introduced LOCcontext.go ×1context.go ×3 · 15 introduced LOCcontext.go ×3event_time_source.go ×1 · 2 introduced LOCevent_time_source.go ×1event_time_source.go ×1 · 11 introduced LOCevent_time_source.go ×1event_time_source.go ×2 · 10 introduced LOCevent_time_source.go ×2event_time_source.go ×3 · 3 introduced LOCevent_time_source.go ×3event_time_source.go ×1 · 2 introduced LOCevent_time_source.go ×1event_time_source.go ×2 · 5 introduced LOCevent_time_source.go ×2event_time_source.go ×1 · 3 introduced LOCevent_time_source.go ×1event_time_source.go ×1 · 5 introduced LOCevent_time_source.go ×1event_time_source.go ×3 · 9 introduced LOCevent_time_source.go ×3event_time_source.go ×2 · 4 introduced LOCevent_time_source.go ×2event_time_source.go ×1 · 6 introduced LOCevent_time_source.go ×1util.go ×1 · 2 introduced LOCutil.go ×1util.go ×1 · 1 introduced LOCutil.go ×1event_time_source.go ×1 · 5 introduced LOCevent_time_source.go ×1util.go ×1 · 2 introduced LOCutil.go ×1TestOperatorServiceMetadata, TestWorkflowServiceMetadata · 0 introduced LOCTestOperatorServiceMetad…go.temporal.io/server/common/clock/context.go · 74 LOCclock/context.gogo.temporal.io/server/common/clock/event_time_source.go · 221 LOCclock/event_time_source.…go.temporal.io/server/common/stream_batcher/batcher.go · 154 LOCstream_batcher/batcher.g…go.temporal.io/server/common/util/util.go · 197 LOCutil/util.goTestOperatorServiceMetadata · introduced test · go.temporal.io/server/common/api/TestOperatorServiceMetadataTestOperatorServiceMetad…TestWorkflowServiceMetadata · introduced test · go.temporal.io/server/common/api/TestWorkflowServiceMetadataTestWorkflowServiceMetad…TestEventTimeSource_AfterFunc_NegativeDelay · introduced test · go.temporal.io/server/common/clock/TestEventTimeSource_AfterFunc_NegativeDelayTestEventTimeSource_Afte…TestStreamBatcher_AddTimeout · introduced test · go.temporal.io/server/common/stream_batcher/TestStreamBatcher_AddTimeoutTestStreamBatcher_AddTim…TestStreamBatcher_MaxDelay · introduced test · go.temporal.io/server/common/stream_batcher/TestStreamBatcher_MaxDelayTestStreamBatcher_MaxDel…TestStreamBatcher_MaxItems · introduced test · go.temporal.io/server/common/stream_batcher/TestStreamBatcher_MaxItemsTestStreamBatcher_MaxIte…TestStreamBatcher_MinDelay · introduced test · go.temporal.io/server/common/stream_batcher/TestStreamBatcher_MinDelayTestStreamBatcher_MinDel…TestStreamBatcher_Random · introduced test · go.temporal.io/server/common/stream_batcher/TestStreamBatcher_RandomTestStreamBatcher_RandomFocused concept · batcher.go ×4 · 18 introduced LOCbatcher.go ×4

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.

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

go.temporal.io/server/common/stream_batcher/batcher.go 16 introduced LOC · 4 ranges

Open complete file

77
78 select {
79 > case <-(*runningC): batcher.go
80 > // we loaded a non-nil running channel, but it closed while we're waiting to
81 > // submit. the goroutine must have just exited. try again.
82 > continue
83 case b.submitC <- pair:
84 select {
89 return zeroR, ctx.Err()
90 }
91 > case <-ctx.Done(): batcher.go
92 > var zeroR R
93 > return zeroR, ctx.Err()
94 }
95 }
98 func (b *Batcher[T, R]) loop(runningC *chan struct{}) {
99 defer func() {
100 > // store nil so that Add knows it should start a goroutine batcher.go
101 > b.running.Store(nil)
102 > // if Add loaded s.running after we decided to stop but before we Stored nil, so it
103 > // thought we were running when we're not, then we need to wake it up so that it can
104 > // start us again.
105 > close(*runningC)
106 > }()
107
108 var items []T
119 items = append(items, pair.item)
120 resps = append(resps, pair.resp)
121 > case <-idleC: batcher.go
122 > return
123 }
124 idleT.Stop()
go.temporal.io/server/common/clock/event_time_source.go 2 introduced LOC · 1 range

Open complete file

130
131 if len(ts.timers) == 0 {
132 > return event_time_source.go
133 > }
134 // just do linear search, this is efficient enough for now
135 tmin := ts.timers[0].deadline