File tree Expand file tree Collapse file tree 2 files changed +28
-0
lines changed
lithic-java-core/src/main/kotlin/com/lithic/api/client Expand file tree Collapse file tree 2 files changed +28
-0
lines changed Original file line number Diff line number Diff line change @@ -34,6 +34,20 @@ import com.lithic.api.services.blocking.TransactionService
3434import com.lithic.api.services.blocking.TransferService
3535import 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+ */
3751interface LithicClient {
3852
3953 fun async (): LithicClientAsync
Original file line number Diff line number Diff line change @@ -35,6 +35,20 @@ import com.lithic.api.services.async.TransferServiceAsync
3535import com.lithic.api.services.async.WebhookServiceAsync
3636import 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+ */
3852interface LithicClientAsync {
3953
4054 fun sync (): LithicClient
You can’t perform that action at this time.
0 commit comments