[exec.get.compl.sched]

# 33 Execution control library [[exec]](./#exec)

## 33.5 Queries [[exec.queries]](exec.queries#exec.get.compl.sched)

### 33.5.9 execution​::​get_completion_scheduler [exec.get.compl.sched]

[1](#1)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/exec.tex#L1035)

get_completion_scheduler<*completion-tag>* obtains
the completion scheduler associated with a completion tag
from a sender's attributes[.](#1.sentence-1)

[2](#2)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/exec.tex#L1040)

The name get_completion_scheduler denotes a query object template[.](#2.sentence-1)

For a subexpression q,
the expression get_completion_scheduler<*completion-tag*>(q) is ill-formed if *completion-tag* is not one ofset_value_t, set_error_t, or set_stopped_t[.](#2.sentence-2)

Otherwise, get_completion_scheduler<*completion-tag*>(q) is expression-equivalent to*MANDATE-NOTHROW*(*AS-CONST*(q).query(get_completion_scheduler<*completion-tag*>))*Mandates*: If the expression above is well-formed,
its type satisfies [scheduler](exec.sched#concept:scheduler "33.6 Schedulers [exec.sched]")[.](#2.sentence-3)

[3](#3)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/exec.tex#L1055)

Let *completion-fn* be a completion function ([[exec.async.ops]](exec.async.ops "33.3 Asynchronous operations"));
let *completion-tag* be
the associated completion tag of *completion-fn*;
let args be a pack of subexpressions; and
let sndr be a subexpression
such that [sender](exec.snd.concepts#concept:sender "33.9.3 Sender concepts [exec.snd.concepts]")<decltype((sndr))> is true andget_completion_scheduler<*completion-tag*>(get_env(sndr)) is well-formed and denotes a scheduler sch[.](#3.sentence-1)

If an asynchronous operation
created by connecting sndr with a receiver rcvr causes the evaluation of *completion-fn*(rcvr, args...),
the behavior is undefined
unless the evaluation happens on an execution agent
that belongs to sch's associated execution resource[.](#3.sentence-2)

[4](#4)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/exec.tex#L1071)

The expressionforwarding_query(get_completion_scheduler<*completion-tag*>) is a core constant expression and has value true[.](#4.sentence-1)
