.. _spawn:

tmc::spawn()
-----------------------------------------------------------------------------------
``spawn()`` produces a task wrapper that exposes several customization functions that allow you to control where an awaitable runs and how the awaiting task is resumed.

By itself, ``spawn()`` doesn't do anything different than just awaiting directly. Its only purpose is to allow customization.

It supports these :ref:`Awaitable Customizations <awaitable_customizations>`:
:literal_ref:`run_on()<run_on>`,
:literal_ref:`resume_on()<resume_on>`,
:literal_ref:`with_priority()<with_priority>`,
:literal_ref:`co_await<co_await>`,
:literal_ref:`fork()<fork>`,
:literal_ref:`detach()<detach>`

API Reference
-----------------------------------------------------------------------------------
.. doxygenfunction:: tmc::spawn(Awaitable &&Task)
