Documentation
¶
Overview ¶
Package flow
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrGroupAlreadyWaiting = errors.New("resultgroup is already waiting")
)
View Source
var (
ErrThrottled = errors.New("throttled")
)
Functions ¶
Types ¶
type Channel ¶ added in v1.10.0
type Channel[T, U any] struct { // contains filtered or unexported fields }
func NewChannel ¶ added in v1.10.0
type Effector ¶
func RetryDelay ¶ added in v1.2.0
Does the same a Retry, but adds a delay after each attempt
func SilentThrottle ¶ added in v1.4.0
type EffectorIn ¶ added in v1.7.0
func SilentThrottleIn ¶ added in v1.7.1
func SilentThrottleIn[T any](f EffectorIn[T], every time.Duration) EffectorIn[T]
func ThrottleIn ¶ added in v1.7.0
func ThrottleIn[T any](f EffectorIn[T], every time.Duration) EffectorIn[T]
type ExpiringStore ¶ added in v1.8.0
type ExpiringStore[T any] struct { // contains filtered or unexported fields }
func NewExpiringStore ¶ added in v1.8.0
func NewExpiringStore[T any]() *ExpiringStore[T]
func (*ExpiringStore[T]) Close ¶ added in v1.8.0
func (e *ExpiringStore[T]) Close()
Close the store, this will block until all items in the store have been expired before it returns, so be careful over the max expiry time you use when adding items to the store
func (*ExpiringStore[T]) Closed ¶ added in v1.8.0
func (e *ExpiringStore[T]) Closed() <-chan struct{}
func (*ExpiringStore[T]) Delete ¶ added in v1.8.0
func (e *ExpiringStore[T]) Delete(id string)
func (*ExpiringStore[T]) Get ¶ added in v1.8.0
func (e *ExpiringStore[T]) Get(id string) (T, bool)
func (*ExpiringStore[T]) Put ¶ added in v1.8.0
func (e *ExpiringStore[T]) Put(id string, val T, exp time.Duration, callbacks ...ExpiryCallback[T])
type ExpiryCallback ¶ added in v1.8.3
type HedgeClient ¶ added in v1.11.0
type HedgeClient struct {
// contains filtered or unexported fields
}
func NewHedgeClient ¶ added in v1.11.0
func NewHedgeClient(c *http.Client, count int) *HedgeClient
type OncePer ¶ added in v1.9.0
type OncePer[T comparable] struct { // contains filtered or unexported fields }
func NewOncePer ¶ added in v1.9.0
func NewOncePer[T comparable]() *OncePer[T]
type Response ¶ added in v1.10.0
type Response[T any] struct { // contains filtered or unexported fields }
type Result ¶ added in v1.3.0
type Result[T any] struct { // contains filtered or unexported fields }
func Eventually ¶ added in v1.3.0
type ResultGroup ¶ added in v1.5.0
type ResultGroup struct {
// contains filtered or unexported fields
}
func (*ResultGroup) Add ¶ added in v1.5.0
func (r *ResultGroup) Add(res resultItem) error
Add an item to the result group This will return an error if Wait has already been called. When Wait has finished, you can add more results to resolve.
func (*ResultGroup) Wait ¶ added in v1.5.0
func (r *ResultGroup) Wait()
Wait blocks until every result has resolved
Click to show internal directories.
Click to hide internal directories.