codesnips
Browse Tags Share a snippet
Sign in
Join us today
Share your craft projects Make new craft buddies Ask craft questions Blog your craft journey
All Latest Trending
java
import java.time.Duration;
import java.util.concurrent.ThreadLocalRandom;
import java.util.function.Predicate;

public final class RetryPolicy {
    private final int maxAttempts;

Async Retry With Exponential Backoff and Full Jitter Using ScheduledExecutorService

java retry backoff
by codesnips 3 tabs
typescript
export interface Todo {
  id: string;
  title: string;
  completed: boolean;
}

Optimistic UI Updates with Rollback Using React Query useMutation

react react-query optimistic-ui
by codesnips 3 tabs
go
package fetch

import (
	"context"
	"net/http"

Bounded Fan-Out With Worker Pool, errgroup, and Result Collection in Go

go concurrency goroutines
by codesnips 3 tabs
java
import jakarta.persistence.*;
import java.math.BigDecimal;
import java.util.Objects;

@Entity
@Table(name = "accounts")

Optimistic Locking with JPA @Version and Retry on Concurrent Updates

jpa hibernate spring
by codesnips 3 tabs
javascript
const RETRYABLE_STATUS = new Set([408, 429, 500, 502, 503, 504]);

export function fullJitter(attempt, baseDelay = 300, maxDelay = 10_000) {
  const ceiling = Math.min(maxDelay, baseDelay * 2 ** attempt);
  return Math.random() * ceiling;
}

Fetch With Exponential Backoff and Full Jitter Retries

fetch retry exponential-backoff
by codesnips 3 tabs
Previous
1 ... 14 15 16
Next
CodeSnips

CodeSnips is crafted with passion and great attention to detail.

Privacy Terms
Facebook Instagram Pinterest
Tags

© 2024 CodeSnips. All Rights Reserved. Running on Ruby on Rails.

Disclaimer: Any posts on CodeSnips.io are posted by individuals acting in their own right and do not necessarily reflect the views of CodeSnips.
CodeSnips will not be held liable for the actions of any user.