xref: /wasmtime-44.0.1/docs/examples-async.md (revision 33224b22)
197e0b7dbSAlex Crichton# Asynchronous Host Functions
297e0b7dbSAlex Crichton
397e0b7dbSAlex CrichtonYou can also [browse this source code online][code] and clone the wasmtime
497e0b7dbSAlex Crichtonrepository to run the example locally.
597e0b7dbSAlex Crichton
6*33224b22SAlex Crichton[code]: https://github.com/bytecodealliance/wasmtime/blob/main/examples/async.cc
797e0b7dbSAlex Crichton
897e0b7dbSAlex CrichtonThis example demonstrates configuring Wasmtime for asynchronous operation and calling async host functions from wasm.
997e0b7dbSAlex Crichton
1097e0b7dbSAlex Crichton## Wasm Source
1197e0b7dbSAlex Crichton
1297e0b7dbSAlex Crichton```wat
1397e0b7dbSAlex Crichton{{#include ../examples/async.wat}}
1497e0b7dbSAlex Crichton```
1597e0b7dbSAlex Crichton
1697e0b7dbSAlex Crichton## Host Source
1797e0b7dbSAlex Crichton
1897e0b7dbSAlex Crichton<!-- langtabs-start -->
1997e0b7dbSAlex Crichton
2097e0b7dbSAlex Crichton```cpp
21*33224b22SAlex Crichton{{#include ../examples/async.cc}}
2297e0b7dbSAlex Crichton```
2397e0b7dbSAlex Crichton
2497e0b7dbSAlex Crichton<!-- langtabs-end -->
25