scheduler.go ×6

Frontier kind: Code frontier

unlabeled · c_b2075eb445b2

19 tests · 3590 LOC · 168 files · introduces 0 tests · 44 LOC · 2 files

Introduces — evidence that enters the hierarchy at this concept

Code
7 ranges44 lines · 2 files
Tests
0 tests

Contains — complete concept membership

All code (extent)
503 ranges3590 lines · 168 files · Browse complete extent
All tests (intent)
19 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.

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

go.temporal.io/server/service/history/queues/scheduler.go 32 introduced LOC · 6 ranges

Open complete file

244 logger log.Logger,
245 metricsHandler metrics.Handler,
246 > ) Scheduler { scheduler.go
247 > if delay := options.StartupDelay(); delay > 0 {
248 > delayedRateLimiter, err := quotas.NewDelayedRequestRateLimiter(
249 > rateLimiter,
250 > delay,
251 > timeSource,
252 > )
253 > if err != nil {
254 logger.Error("Failed to create delayed rate limited scheduler", tag.Error(err))
255 return baseScheduler
256 }
257
258 > rateLimiter = delayedRateLimiter scheduler.go
259 }
260
261 > taskQuotaRequestFn := func(e Executable) quotas.Request { scheduler.go
262 namespaceName, err := namespaceRegistry.GetNamespaceName(namespace.ID(e.GetNamespaceID()))
263 if err != nil {
266 return quotas.NewRequest(e.GetType().String(), taskSchedulerToken, namespaceName.String(), e.GetPriority().CallerType(), 0, "")
267 }
268 > taskMetricsTagsFn := func(e Executable) []metrics.Tag { scheduler.go
269 return append(
270 taskBaseMetricTags(e.GetTask(), namespaceRegistry, currentClusterName, chasmRegistry, GetTaskTypeTagValue),
273 }
274
275 > rateLimitedScheduler := tasks.NewRateLimitedScheduler[Executable]( scheduler.go
276 > baseScheduler,
277 > rateLimiter,
278 > timeSource,
279 > taskQuotaRequestFn,
280 > taskMetricsTagsFn,
281 > tasks.RateLimitedSchedulerOptions{
282 > Enabled: options.Enabled,
283 > EnableShadowMode: options.EnableShadowMode,
284 > },
285 > logger,
286 > metricsHandler,
287 > )
288 >
289 > return &rateLimitedSchedulerImpl{
290 > Scheduler: rateLimitedScheduler,
291 > baseScheduler: baseScheduler,
292 > }
293 }
294
301 }
302
303 > func (s *rateLimitedSchedulerImpl) TaskChannelKeyFn() TaskChannelKeyFn { scheduler.go
304 > return s.baseScheduler.TaskChannelKeyFn()
305 > }
306
307 // HandleBusyWorkflow implements BusyWorkflowHandler by delegating to the
go.temporal.io/server/common/tasks/rate_limited_scheduler.go 12 introduced LOC · 1 range

Open complete file

44 logger log.Logger,
45 metricsHandler metrics.Handler,
46 > ) *RateLimitedScheduler[T] { rate_limited_scheduler.go
47 > return &RateLimitedScheduler[T]{
48 > scheduler: scheduler,
49 > rateLimiter: rateLimiter,
50 > timeSource: timeSource,
51 > quotaRequestFn: quotaRequestFn,
52 > metricTagsFn: metricTagsFn,
53 > options: options,
54 > logger: logger,
55 > metricsHandler: metricsHandler,
56 > }
57 > }
58
59 func (s *RateLimitedScheduler[T]) Submit(task T) {