export interface RetryOptions {
retries: number;
baseMs: number;
maxMs: number;
signal?: AbortSignal;
onRetry?: (attempt: number, delay: number, err: unknown) => void;
package com.example.myapp.data.remote
import com.squareup.moshi.Moshi
import com.squareup.moshi.kotlin.reflect.KotlinJsonAdapterFactory
import okhttp3.OkHttpClient
import okhttp3.logging.HttpLoggingInterceptor
# AWS VPC with public/private subnets across 3 AZs
data "aws_availability_zones" "available" {
state = "available"
}
import { Agent as HttpAgent } from 'http';
import { Agent as HttpsAgent } from 'https';
const shared = {
keepAlive: true,
keepAliveMsecs: 1_000,
require "faraday"
require "faraday/retry"
module Http
class RetryableError < StandardError; end
class CircuitOpenError < StandardError; end
#!/usr/bin/env bash
# Docker Networking Modes & Configuration
# === List networks ===
docker network ls
docker network inspect bridge
package middleware
import (
"net"
"net/http"
"net/netip"
# ClusterIP Service (internal only)
apiVersion: v1
kind: Service
metadata:
name: web-app
namespace: production
package com.example.github;
import java.util.List;
import retrofit2.Call;
import retrofit2.http.GET;
import retrofit2.http.Path;
// 1. Basic WebSocket connection
const socket = new WebSocket('wss://example.com/ws');
// Connection opened
socket.addEventListener('open', (event) => {
console.log('Connected to WebSocket server');
import random
from dataclasses import dataclass
from typing import Iterator
@dataclass(frozen=True)
package proxy
import (
"log"
"net"
"net/http"