modernice/goes

Add `handler.Debounce()` option

Opened this issue · 0 comments

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))
}