Documentation ¶
Index ¶
- func MaxRequestThreshold[T slot.IndexedID](maxRequestThreshold int) options.Option[EventTicker[T]]
- func RetryInterval[T slot.IndexedID](interval time.Duration) options.Option[EventTicker[T]]
- func RetryJitter[T slot.IndexedID](retryJitter time.Duration) options.Option[EventTicker[T]]
- type EventTicker
- func (r *EventTicker[T]) EvictUntil(index slot.Index)
- func (r *EventTicker[T]) HasTicker(id T) bool
- func (r *EventTicker[T]) QueueSize() int
- func (r *EventTicker[T]) Shutdown()
- func (r *EventTicker[T]) StartTicker(id T)
- func (r *EventTicker[T]) StartTickers(ids []T)
- func (r *EventTicker[T]) StopTicker(id T)
- type Events
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MaxRequestThreshold ¶
MaxRequestThreshold creates an option which defines how often the EventTicker should try to request blocks before canceling the request.
func RetryInterval ¶
RetryInterval creates an option which sets the retry interval to the given value.
func RetryJitter ¶
RetryJitter creates an option which sets the retry jitter to the given value.
Types ¶
type EventTicker ¶
type EventTicker[T slot.IndexedID] struct { Events *Events[T] // contains filtered or unexported fields }
EventTicker takes care of requesting blocks.
func New ¶
func New[T slot.IndexedID](opts ...options.Option[EventTicker[T]]) *EventTicker[T]
New creates a new block requester.
func (*EventTicker[T]) EvictUntil ¶
func (r *EventTicker[T]) EvictUntil(index slot.Index)
func (*EventTicker[T]) HasTicker ¶
func (r *EventTicker[T]) HasTicker(id T) bool
func (*EventTicker[T]) QueueSize ¶
func (r *EventTicker[T]) QueueSize() int
func (*EventTicker[T]) Shutdown ¶
func (r *EventTicker[T]) Shutdown()
func (*EventTicker[T]) StartTicker ¶
func (r *EventTicker[T]) StartTicker(id T)
func (*EventTicker[T]) StartTickers ¶
func (r *EventTicker[T]) StartTickers(ids []T)
func (*EventTicker[T]) StopTicker ¶
func (r *EventTicker[T]) StopTicker(id T)
type Events ¶
type Events[T slot.IndexedID] struct { // Request is an event that is triggered when the requester wants to request the given entity. Tick *event.Event1[T] // RequestQueued is an event that is triggered when a new request is started. TickerStarted *event.Event1[T] // RequestStopped is an event that is triggered when a request is stopped. TickerStopped *event.Event1[T] // RequestFailed is an event that is triggered when a request is stopped after too many attempts. TickerFailed *event.Event1[T] event.Group[Events[T], *Events[T]] }
Events represents events happening on a EventTicker.
Click to show internal directories.
Click to hide internal directories.