Skip to content

Add debounce utility snippet #244

@iluwatar

Description

@iluwatar

Description:

Create a reusable Java utility to debounce method calls. The method should delay execution of a task until a fixed period has passed since the last invocation. This is particularly useful in GUI applications and search fields to prevent spamming actions.

Acceptance Criteria:

  • New debounce snippet has been added
  • Method signature could be debounce(Runnable task, long delayMillis) or something similar
  • Task is executed only if no call was made within delayMillis
  • Include a test that proves the code is working (e.g. using ScheduledExecutorService)

Metadata

Metadata

Assignees

No one assigned

    Projects

    Status

    Todo

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions