ratelimiter

package
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 22, 2026 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type LeakyBucket

type LeakyBucket struct {
	actor.ActorBase
	// contains filtered or unexported fields
}

LeakyBucket is a rate-limiter actor that tracks order timestamps in a circular buffer and writes the next-accepted time to the shared cache.

func NewLeakyBucket

func NewLeakyBucket(cat *catalog.Catalog, bus *msgbus.MsgBus, c *cache.Cache) *LeakyBucket

NewLeakyBucket creates a new LeakyBucket actor with default subscriptions.

func (*LeakyBucket) Handle

func (lb *LeakyBucket) Handle(ev msgbus.Event, bus *msgbus.MsgBus)

func (*LeakyBucket) OnInit

func (lb *LeakyBucket) OnInit(config map[string]any)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
⌂ 换网址