File: execute.adoc

package info (click to toggle)
boost1.90 1.90.0-1
  • links: PTS, VCS
  • area: main
  • in suites:
  • size: 593,120 kB
  • sloc: cpp: 4,190,908; xml: 196,648; python: 34,618; ansic: 23,145; asm: 5,468; sh: 3,774; makefile: 1,161; perl: 1,020; sql: 728; ruby: 676; yacc: 478; java: 77; lisp: 24; csh: 6
file content (33 lines) | stat: -rw-r--r-- 1,124 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33

== `execute.hpp`
[#execute]

The execute header provides two error categories:

[source,cpp]
----

// Run a process and wait for it to complete.
template<typename Executor> int execute(basic_process<Executor> proc);
template<typename Executor> int execute(basic_process<Executor> proc, error_code & ec)

// Execute a process asynchronously
template<typename Executor = net::any_io_executor,
        BOOST_PROCESS_V2_COMPLETION_TOKEN_FOR(void (error_code, int))
        WaitHandler = net::default_completion_token_t<Executor>>
auto async_execute(basic_process<Executor> proc,
                         WaitHandler && handler = net::default_completion_token_t<Executor>());
----

The `async_execute` function asynchronously for a process to complete.

 Cancelling the execution will signal the child process to exit
 with the following interpretations:

- `cancellation_type::total`    -> interrupt
- `cancellation_type::partial`  -> request_exit
- `cancellation_type::terminal` -> terminate

It is to note that `async_execute` will use the lowest selected cancellation
type. A subprocess might ignore anything not terminal.