Documentation ¶
Index ¶
- Constants
- func DecorateConsumer[T any](limiter TimeLimiter, fn consumer.Consumer[T]) consumer.Consumer[T]
- func DecorateFunction[T any, R any](limiter TimeLimiter, fn function.Function[T, R]) function.Function[T, R]
- func DecorateRunnable(limiter TimeLimiter, fn runnable.Runnable) runnable.Runnable
- func DecorateSupplier[T any](limiter TimeLimiter, fn supplier.Supplier[T]) supplier.Supplier[T]
- type Config
- type ConfigBuilder
- type Event
- type EventConsumer
- type EventListener
- type EventType
- type Metrics
- type TimeLimiter
- type TimeoutError
Constants ¶
View Source
const DefaultTimeoutDuration = time.Second
Variables ¶
This section is empty.
Functions ¶
func DecorateConsumer ¶
func DecorateFunction ¶
func DecorateRunnable ¶
func DecorateRunnable(limiter TimeLimiter, fn runnable.Runnable) runnable.Runnable
func DecorateSupplier ¶
Types ¶
type ConfigBuilder ¶
type ConfigBuilder func(*Config)
func WithTimeoutDuration ¶
func WithTimeoutDuration(timeoutDuration time.Duration) ConfigBuilder
type EventConsumer ¶
type EventConsumer func(Event)
type EventListener ¶
type EventListener interface { OnSuccess(EventConsumer) EventListener OnTimeout(EventConsumer) EventListener OnFailure(EventConsumer) EventListener Dismiss(EventConsumer) EventListener HasConsumer() bool // contains filtered or unexported methods }
type TimeLimiter ¶
type TimeLimiter interface { Name() string Metrics() Metrics EventListener() EventListener // contains filtered or unexported methods }
func NewTimeLimiter ¶
func NewTimeLimiter(name string, configs ...ConfigBuilder) TimeLimiter
type TimeoutError ¶
type TimeoutError struct {
// contains filtered or unexported fields
}
func (*TimeoutError) Error ¶
func (e *TimeoutError) Error() string
Click to show internal directories.
Click to hide internal directories.