CtrlK
BlogDocsLog inGet started
Tessl Logo

tessl/maven-com-squareup-okhttp3--okhttp

Square's meticulous HTTP client for Java and Kotlin

Pending
Overview
Eval results
Files

networking.mddocs/

Connection Management

Connection pooling, dispatching, and network configuration for optimal performance.

ConnectionPool

Manages HTTP and HTTPS connections for reuse to reduce latency.

class ConnectionPool(
    maxIdleConnections: Int = 5,
    keepAliveDuration: Long = 5,
    timeUnit: TimeUnit = TimeUnit.MINUTES
) {
    constructor(maxIdleConnections: Int, keepAliveDuration: Duration)
    
    fun idleConnectionCount(): Int
    fun connectionCount(): Int
    fun evictAll()
}

Dispatcher

Policy for request execution, including maximum concurrent requests.

class Dispatcher {
    constructor()
    constructor(executorService: ExecutorService)
    
    var maxRequests: Int
    var maxRequestsPerHost: Int
    var idleCallback: Runnable?
    val executorService: ExecutorService
    
    fun cancelAll()
    fun runningCallsCount(): Int
    fun queuedCallsCount(): Int
    fun runningCalls(): List<Call>
    fun queuedCalls(): List<Call>
}

Install with Tessl CLI

npx tessl i tessl/maven-com-squareup-okhttp3--okhttp

docs

caching.md

cookies.md

forms-multipart.md

http-client.md

index.md

interceptors.md

networking.md

requests-responses.md

security.md

urls.md

websockets.md

tile.json