DEV Community

Cover image for Knative async [beta]
Ashok Nagaraj
Ashok Nagaraj

Posted on

Knative async [beta]

Knative async is a feature that allows Knative services to be called asynchronously or conditionally asynchronously. It is currently in beta with the core functionality in place. Knative async is part of Knative Eventing, which is responsible for interconnecting asynchronously all the different parts of your distributed application.

Main benefit is that it helps free-up local resources following a true non-blocking model for long running connections using a queue. The requester just gets a 202-Accepted as an acknowledgement.

Knative async works by creating a custom ingress for each Knative service that supports asynchronous invocation. The ingress contains an annotation that is read by the networking controller, which then creates the specific components necessary for that network mesh type. The components include a queue-proxy sidecar container that handles buffering requests until they are ready to be processed by the service.

To invoke a service asynchronously, you can either label it as always asynchronous or conditionally asynchronous. Always asynchronous services do not need a special header to be called asynchronously, while conditionally asynchronous services will respond when the Prefer: respond-async header is provided as part of the request.

Most of the content on this beta feature is here:

Top comments (0)