Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add handler.Debounce() option #153

Open
bounoable opened this issue Sep 23, 2023 · 0 comments
Open

Add handler.Debounce() option #153

bounoable opened this issue Sep 23, 2023 · 0 comments
Labels
enhancement New feature or request

Comments

@bounoable
Copy link
Contributor

bounoable commented Sep 23, 2023

Usage

Example: Debounce incoming events by 3 seconds to batch-process them at once. Wait for a maximum of 10 seconds before force-handling the events.

package example

import (
  "time"

  "github.com/modernice/goes/event"
  "github.com/modernice/goes/event/handler"
)

func example(bus event.Bus) {
  h := handler.New(bus, handler.Debounce(3*time.Second, 10*time.Second))
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant