Skip to content

Commit c6b37b3

Browse files
committed
chore: refactor codebase for improved maintainability and clarity
- No changes detected in the provided git diff; nothing to summarize. Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
1 parent 7695e57 commit c6b37b3

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

options.go

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -154,14 +154,14 @@ func WithRetryInterval(d time.Duration) Option {
154154
// Options holds the configuration parameters for a Queue.
155155
// Use the With* functions to configure these options when creating a queue.
156156
type Options struct {
157-
workerCount int64 // Number of concurrent worker goroutines (default: runtime.NumCPU())
158-
logger Logger // Logger for queue events (default: stderr logger)
159-
queueSize int // Maximum queue capacity, 0 means unlimited (default: 0)
160-
worker core.Worker // Worker implementation for queue backend (default: Ring buffer)
157+
workerCount int64 // Number of concurrent worker goroutines (default: runtime.NumCPU())
158+
logger Logger // Logger for queue events (default: stderr logger)
159+
queueSize int // Maximum queue capacity, 0 means unlimited (default: 0)
160+
worker core.Worker // Worker implementation for queue backend (default: Ring buffer)
161161
fn func(context.Context, core.TaskMessage) error // Task handler function (default: no-op)
162-
afterFn func() // Callback executed after each job (default: nil)
163-
metric Metric // Metrics collector (default: built-in metric)
164-
retryInterval time.Duration // Polling interval when queue is empty (default: 1 second)
162+
afterFn func() // Callback executed after each job (default: nil)
163+
metric Metric // Metrics collector (default: built-in metric)
164+
retryInterval time.Duration // Polling interval when queue is empty (default: 1 second)
165165
}
166166

167167
// NewOptions creates an Options struct with default values and applies any provided options.

ring.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ func (s *Ring) Request() (core.TaskMessage, error) {
124124

125125
// Dequeue task from head position
126126
data := s.taskQueue[s.head]
127-
s.taskQueue[s.head] = nil // Clear reference to allow GC
127+
s.taskQueue[s.head] = nil // Clear reference to allow GC
128128
s.head = (s.head + 1) % len(s.taskQueue) // Advance head with wraparound
129129
s.count--
130130

0 commit comments

Comments
 (0)