Alternate of using "delivery callback"
You are looking for responses. For example, in a controller, you can return a renderable array, a Symfony Response object, or specific responses (AjaxResponse, JsonResponse) to respond to the request. 

For example, AjaxResponse in the docs, and here is an example of a controller responding with it:

https://www.mike-miles.com/blog/creating-ajax-callback-commands-drupal-8