Asynchronous API
Jump to navigation
Jump to search
An Asynchronous API is an API designed to handle tasks that do not require an immediate response.
- AKA: Async API.
- Context:
- It can (typically) enable real-time updates and efficient handling of tasks in Event-Driven Architecture.
- It can (often) facilitate Non-Blocking Operations.
- It can range from using protocols such as HTTP and MQTT to more complex ones like AMQP and Kafka.
- It can utilize mechanisms like Webhooks, WebSockets, Server-Sent Events (SSE), and Message Queues for communication.
- It can implement Callbacks for the server to notify the client upon task completion.
- ...
- Example(s):
- a Facebook Messenger that uses an Async API to handle instant messaging, sending messages asynchronously via POST requests.
- a Multiplayer Video Game like World of Warcraft, which uses Async APIs to manage in-game communication and events.
- a Gmail API that handles email operations asynchronously, returning metadata in JSON format upon successful message delivery.
- an Asana API that includes asynchronous features for task management and notifications using webhooks.
- ...
- Counter-Example(s):
- Synchronous APIs, which require the client to wait for an immediate response from the server.
- See: Event-Driven Architecture, Non-Blocking Operations, WebSockets, Server-Sent Events (SSE), Message Queues, Callbacks