File tree Expand file tree Collapse file tree 4 files changed +30
-0
lines changed
increase-java-core/src/main/kotlin/com/increase/api/client Expand file tree Collapse file tree 4 files changed +30
-0
lines changed Original file line number Diff line number Diff line change @@ -171,4 +171,17 @@ interface IncreaseClient {
171171 fun realTimePaymentsRequestForPayments (): RealTimePaymentsRequestForPaymentService
172172
173173 fun simulations (): SimulationService
174+
175+ /* *
176+ * Closes this client, relinquishing any underlying resources.
177+ *
178+ * This is purposefully not inherited from [AutoCloseable] because the client is long-lived and
179+ * usually should not be synchronously closed via try-with-resources.
180+ *
181+ * It's also usually not necessary to call this method at all. the default HTTP client
182+ * automatically releases threads and connections if they remain idle, but if you are writing an
183+ * application that needs to aggressively release unused resources, then you may call this
184+ * method.
185+ */
186+ fun close ()
174187}
Original file line number Diff line number Diff line change @@ -171,4 +171,17 @@ interface IncreaseClientAsync {
171171 fun realTimePaymentsRequestForPayments (): RealTimePaymentsRequestForPaymentServiceAsync
172172
173173 fun simulations (): SimulationServiceAsync
174+
175+ /* *
176+ * Closes this client, relinquishing any underlying resources.
177+ *
178+ * This is purposefully not inherited from [AutoCloseable] because the client is long-lived and
179+ * usually should not be synchronously closed via try-with-resources.
180+ *
181+ * It's also usually not necessary to call this method at all. the default HTTP client
182+ * automatically releases threads and connections if they remain idle, but if you are writing an
183+ * application that needs to aggressively release unused resources, then you may call this
184+ * method.
185+ */
186+ fun close ()
174187}
Original file line number Diff line number Diff line change @@ -467,4 +467,6 @@ constructor(
467467 override fun webhooks (): WebhookServiceAsync = webhooks
468468
469469 override fun simulations (): SimulationServiceAsync = simulations
470+
471+ override fun close () = clientOptions.httpClient.close()
470472}
Original file line number Diff line number Diff line change @@ -451,4 +451,6 @@ constructor(
451451 override fun webhooks (): WebhookService = webhooks
452452
453453 override fun simulations (): SimulationService = simulations
454+
455+ override fun close () = clientOptions.httpClient.close()
454456}
You can’t perform that action at this time.
0 commit comments