![]() |
Home | Libraries | People | FAQ | More |
Create a trampoline object for an executor.
template< typename Executor, = constraint_t< is_executor<Executor>::value || execution::is_executor<Executor>::value >> trampoline< Executor > make_trampoline( const Executor & ex, std::size_t calls, std::size_t max_inline_depth = 0);
The target executor.
The maximum number of additional calls (i.e. excluding the call that
installs the trampoline) that can be run on the trampoline, if the
returned executor installs the trampoline. Pass (std::numeric_limits<std::size_t>::max)()
to specify that the trampoline places no bound on the number of calls.
The deepest a blocking.possibly
execute()
made from inside this trampoline's own frame may run immediately
rather than queue, counting the nesting of such immediate calls already
underway. A nested function that runs this way runs before the remainder
of its caller, ahead of whatever is already queued on the frame.
It still spends one of calls,
the same as a queued call. A value of 0, the default, means that
every dispatched function is queued, and runs only as the frame is
drained.
if max_inline_depth
is greater than 255.
A trampoline constructed
with the specified executor, and a freshly allocated identity. Passing
an existing trampoline
as ex is not a special
case. As with make_strand
wrapping an existing strand, it creates a new trampoline, with its own
fresh identity, over that one as its target. The two do not join each other's
trampolines.