class WebhookSignature
class VerificationError < StandardError; end
TOLERANCE = 300 # seconds
def initialize(payload:, header:, secrets:)
package ratelimit
import (
"sync"
"time"
)
-- KEYS[1] = bucket key
-- ARGV: capacity, refillPerSec, now(ms), cost, ttl(sec)
local capacity = tonumber(ARGV[1])
local refill = tonumber(ARGV[2])
local now = tonumber(ARGV[3])
local cost = tonumber(ARGV[4])
use std::time::Duration;
use tokio_util::sync::CancellationToken;
pub struct Worker {
id: usize,
token: CancellationToken,
@Configuration
@EnableAsync
public class AsyncConfig {
@Bean(name = "orderExecutor")
public ThreadPoolTaskExecutor orderExecutor() {
CREATE TYPE outbox_status AS ENUM ('pending', 'retry', 'processing', 'done', 'dead');
CREATE TABLE outbox_events (
id BIGINT GENERATED ALWAYS AS IDENTITY PRIMARY KEY,
dedupe_key TEXT NOT NULL,
topic TEXT NOT NULL,
import random
from dataclasses import dataclass
from typing import Iterator
@dataclass(frozen=True)
<?php
namespace App\Entity;
trait RecordsEvents
{
package com.shop.orders.events;
import java.math.BigDecimal;
import java.time.Instant;
public record OrderPlacedEvent(
package config
import (
"fmt"
"os"
"strconv"
export interface CronFields {
minute: Set<number>;
hour: Set<number>;
dayOfMonth: Set<number>;
month: Set<number>;
dayOfWeek: Set<number>;
require "securerandom"
class RedisMutex
class LockError < StandardError; end
UNLOCK_SCRIPT = <<~LUA.freeze