Skip to content

Commit

Permalink
Remove deprecated constructor and methods.
Browse files Browse the repository at this point in the history
  • Loading branch information
creachadair committed Sep 26, 2024
1 parent de3fb02 commit 2be6922
Showing 1 changed file with 0 additions and 15 deletions.
15 changes: 0 additions & 15 deletions collector.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,6 @@ func (c *Collector[T]) report(v T) {
c.handle(v)
}

// NewCollector is an alias for [Collect].
//
// Deprecated: Use Collect instead.
func NewCollector[T any](value func(T)) *Collector[T] { return Collect(value) }

// Collect creates a new collector that delivers task values to the specified
// accumulator function. The collector serializes calls to value, so that it is
// safe for the function to access shared state without a lock.
Expand All @@ -29,11 +24,6 @@ func NewCollector[T any](value func(T)) *Collector[T] { return Collect(value) }
// reported by the underlying function have been processed by the accumulator.
func Collect[T any](value func(T)) *Collector[T] { return &Collector[T]{handle: value} }

// Task is an alias for Call.
//
// Deprecated: Use Call instead.
func (c *Collector[T]) Task(f func() (T, error)) Task { return c.Call(f) }

// Call returns a Task wrapping a call to f. If f reports an error, that error
// is propagated as the return value of the task; otherwise, the non-error
// value reported by f is passed to the value callback.
Expand All @@ -55,11 +45,6 @@ func (c *Collector[T]) Report(f func(report func(T)) error) Task {
return func() error { return f(c.report) }
}

// NoError is an alias for Run.
//
// Deprecated: Use Run instead.
func (c *Collector[T]) NoError(f func() T) Task { return c.Run(f) }

// Run returns a Task wrapping a call to f. The resulting task reports a nil
// error for all calls.
func (c *Collector[T]) Run(f func() T) Task {
Expand Down

0 comments on commit 2be6922

Please sign in to comment.