Skip to content
This repository was archived by the owner on Aug 29, 2025. It is now read-only.

Commit e0e642d

Browse files
committed
takeout comment
1 parent 5603223 commit e0e642d

File tree

2 files changed

+1
-7
lines changed

2 files changed

+1
-7
lines changed

pkg/queue/queue.go

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,13 @@ import (
1010
"github.com/sheenazien8/goplate/pkg/models"
1111
)
1212

13-
// Task defines the work to be processed by the queue
1413
type Task func()
1514

16-
// Queue represents a simple in-memory task queue with worker pool
1715
type Queue struct {
1816
tasks chan Task
1917
wg sync.WaitGroup
2018
}
2119

22-
// New creates a new Queue with the specified buffer size
2320
func New(bufferSize int) *Queue {
2421
return &Queue{
2522
tasks: make(chan Task, bufferSize),
@@ -93,17 +90,14 @@ func ptr[T any](v T) *T {
9390
return &v
9491
}
9592

96-
// Registry maps job type string to a function that builds and returns a Job
9793
var registry = map[string]func() Job{}
9894

99-
// RegisterJob registers a job handler with a type string
10095
func RegisterJob(job Job) {
10196
registry[job.Type()] = func() Job {
10297
return job
10398
}
10499
}
105100

106-
// ResolveJob looks up and creates a job instance from type
107101
func ResolveJob(typeName string, payload json.RawMessage) (Job, error) {
108102
creator, exists := registry[typeName]
109103
if !exists {

pkg/scheduler/main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,6 @@ func (s *Scheduler) Stop() context.Context {
4343

4444
var SchedulerRegistry = map[string]func() (spec string, task func()){}
4545

46-
func registerScheduler(name string, scheduler func() (spec string, task func())) {
46+
func RegisterScheduler(name string, scheduler func() (spec string, task func())) {
4747
SchedulerRegistry[name] = scheduler
4848
}

0 commit comments

Comments
 (0)