Interface KnockClientAsync
-
- All Implemented Interfaces:
public interface KnockClientAsyncA client for interacting with the Knock REST API asynchronously. You can also switch to synchronous execution via the sync method.
This client performs best when you create a single instance and reuse it for all interactions with the REST API. This is because each client holds its own connection pool and thread pools. Reusing connections and threads reduces latency and saves memory. The client also handles rate limiting per client. This means that creating and using multiple instances at the same time will not respect rate limits.
The threads and connections that are held will be released automatically if they remain idle. But if you are writing an application that needs to aggressively release unused resources, then you may call close.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public interfaceKnockClientAsync.WithRawResponseA view of KnockClientAsync that provides access to raw HTTP responses for each method.
-
Method Summary
Modifier and Type Method Description abstract KnockClientsync()Returns a version of this client that uses synchronous execution. abstract KnockClientAsync.WithRawResponsewithRawResponse()Returns a view of this service that provides access to raw HTTP responses for each method. abstract SharedServiceAsyncshared()abstract RecipientServiceAsyncrecipients()abstract UserServiceAsyncusers()abstract ObjectServiceAsyncobjects()abstract TenantServiceAsynctenants()abstract BulkOperationServiceAsyncbulkOperations()abstract MessageServiceAsyncmessages()abstract ProviderServiceAsyncproviders()abstract IntegrationServiceAsyncintegrations()abstract WorkflowServiceAsyncworkflows()abstract ScheduleServiceAsyncschedules()abstract ChannelServiceAsyncchannels()abstract AudienceServiceAsyncaudiences()abstract Unitclose()Closes this client, relinquishing any underlying resources. -
-
Method Detail
-
sync
abstract KnockClient sync()
Returns a version of this client that uses synchronous execution.
The returned client shares its resources, like its connection pool and thread pools, with this client.
-
withRawResponse
abstract KnockClientAsync.WithRawResponse withRawResponse()
Returns a view of this service that provides access to raw HTTP responses for each method.
-
shared
abstract SharedServiceAsync shared()
-
recipients
abstract RecipientServiceAsync recipients()
-
users
abstract UserServiceAsync users()
-
objects
abstract ObjectServiceAsync objects()
-
tenants
abstract TenantServiceAsync tenants()
-
bulkOperations
abstract BulkOperationServiceAsync bulkOperations()
-
messages
abstract MessageServiceAsync messages()
-
providers
abstract ProviderServiceAsync providers()
-
integrations
abstract IntegrationServiceAsync integrations()
-
workflows
abstract WorkflowServiceAsync workflows()
-
schedules
abstract ScheduleServiceAsync schedules()
-
channels
abstract ChannelServiceAsync channels()
-
audiences
abstract AudienceServiceAsync audiences()
-
close
abstract Unit close()
Closes this client, relinquishing any underlying resources.
This is purposefully not inherited from AutoCloseable because the client is long-lived and usually should not be synchronously closed via try-with-resources.
It's also usually not necessary to call this method at all. the default HTTP client automatically releases threads and connections if they remain idle, but if you are writing an application that needs to aggressively release unused resources, then you may call this method.
-
-
-
-