IdempotencyChecker

fun interface IdempotencyChecker

Interface for checking idempotency of operations to prevent duplicate processing. Idempotency checkers determine whether a given element (typically a command or request identifier) has been processed before, ensuring that operations can be safely retried without side effects.

Author

ahoo wang

Inheritors

Functions

Link copied to clipboard
abstract fun check(element: String): Boolean

Checks if the given element passes the idempotency test. Returns true if the element is considered unique (not a duplicate), false if it's a duplicate.

Link copied to clipboard
open fun release(element: String)

Gives back the reservation check made for element when the operation it guarded did not happen (for example the command could not be sent), so that a retry with the same element passes check again.