The reference implementation for asychronous processing uses NATS Streaming, but you are free to extend OpenFaaS and write your own [queue-worker](https://github.com/open-faas/nats-queue-worker).
Swarm:
```
$ ./deploy_extended.sh
```
K8s:
```
$ kubectl -f delete ./faas.yml
$ kubectl -f apply ./faas.async.yml,nats.yml
```
## Call a function
Functions do not need to be modified to work asynchronously, just use this alternate route:
```
$ http://gateway/async-function/{function_name}
```
If you want the function to call another function or a different endpoint when it is finished then pass the `X-Callback-Url` header. This is optional.