Skip to content

Commit 3cb8525

Browse files
stainless-app[bot]stainless-bot
authored andcommitted
docs: add client documentation (#464)
1 parent e621cd6 commit 3cb8525

File tree

2 files changed

+28
-0
lines changed

2 files changed

+28
-0
lines changed

lithic-java-core/src/main/kotlin/com/lithic/api/client/LithicClient.kt

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,20 @@ import com.lithic.api.services.blocking.TransactionService
3434
import com.lithic.api.services.blocking.TransferService
3535
import com.lithic.api.services.blocking.WebhookService
3636

37+
/**
38+
* A client for interacting with the Lithic REST API synchronously. You can also switch to
39+
* asynchronous execution via the [async] method.
40+
*
41+
* This client performs best when you create a single instance and reuse it for all interactions
42+
* with the REST API. This is because each client holds its own connection pool and thread pools.
43+
* Reusing connections and threads reduces latency and saves memory. The client also handles rate
44+
* limiting per client. This means that creating and using multiple instances at the same time will
45+
* not respect rate limits.
46+
*
47+
* The threads and connections that are held will be released automatically if they remain idle. But
48+
* if you are writing an application that needs to aggressively release unused resources, then you
49+
* may call [close].
50+
*/
3751
interface LithicClient {
3852

3953
fun async(): LithicClientAsync

lithic-java-core/src/main/kotlin/com/lithic/api/client/LithicClientAsync.kt

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,20 @@ import com.lithic.api.services.async.TransferServiceAsync
3535
import com.lithic.api.services.async.WebhookServiceAsync
3636
import java.util.concurrent.CompletableFuture
3737

38+
/**
39+
* A client for interacting with the Lithic REST API asynchronously. You can also switch to
40+
* synchronous execution via the [sync] method.
41+
*
42+
* This client performs best when you create a single instance and reuse it for all interactions
43+
* with the REST API. This is because each client holds its own connection pool and thread pools.
44+
* Reusing connections and threads reduces latency and saves memory. The client also handles rate
45+
* limiting per client. This means that creating and using multiple instances at the same time will
46+
* not respect rate limits.
47+
*
48+
* The threads and connections that are held will be released automatically if they remain idle. But
49+
* if you are writing an application that needs to aggressively release unused resources, then you
50+
* may call [close].
51+
*/
3852
interface LithicClientAsync {
3953

4054
fun sync(): LithicClient

0 commit comments

Comments
 (0)