Documentation ¶
Index ¶
- type BackgroundLimiter
- func (bg *BackgroundLimiter) Add(fn func(ctx context.Context) error) <-chan error
- func (bg *BackgroundLimiter) AddWithTimeout(fn func(ctx context.Context) error, timeout time.Duration) <-chan error
- func (bg *BackgroundLimiter) Close() error
- func (bg *BackgroundLimiter) Context() context.Context
- func (bg *BackgroundLimiter) IsCanceled() bool
- func (bg *BackgroundLimiter) Wait()
- func (bg *BackgroundLimiter) WaitWithContext(ctx context.Context) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BackgroundLimiter ¶
type BackgroundLimiter struct {
// contains filtered or unexported fields
}
func NewWithContext ¶
func NewWithContext(ctx context.Context, limit int) *BackgroundLimiter
NewWithContext returns a new runner with the given parent context and limit, if limit is <= 0 it won't have a limit.
func (*BackgroundLimiter) Add ¶
func (bg *BackgroundLimiter) Add(fn func(ctx context.Context) error) <-chan error
func (*BackgroundLimiter) AddWithTimeout ¶
func (*BackgroundLimiter) Close ¶
func (bg *BackgroundLimiter) Close() error
func (*BackgroundLimiter) Context ¶
func (bg *BackgroundLimiter) Context() context.Context
func (*BackgroundLimiter) IsCanceled ¶
func (bg *BackgroundLimiter) IsCanceled() bool
func (*BackgroundLimiter) Wait ¶
func (bg *BackgroundLimiter) Wait()
func (*BackgroundLimiter) WaitWithContext ¶
func (bg *BackgroundLimiter) WaitWithContext(ctx context.Context) error
Click to show internal directories.
Click to hide internal directories.