Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Command queue: execution policy
data class ExecutionPolicy(
/** How many processes (coroutines, really) to run in parallel. */
val concurrency: Int,
/**
* How much time to wait before processing a command specification/scheduled task.
*
* Consequently, that time is the window during which tasks are subject to deduplication.
*
* Note: that delay can't have a precision of less than 1 second.
*
* @see CommandSpecification.deduplicate
*/
val delayBeforeConsideringTask: Duration,
/**
* How many times to retry executing a command that fails, before giving up and putting it
* into quarantine.
*/
val maxRetriesBeforeQuarantine: Int,
/**
* Optional rate limit(s) to apply to command consumption, for instance so as to comply with
* limits of some other "provider" (i.e. external system called by commands to provide some
* service).
*/
val rateLimits: RateLimits = noRateLimits(),
/**
* Optional circuit breaking configuration to apply to command consumption.
*/
val circuitBreaking: CircuitBreaking? = null
) { ... }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment