MCPcopy Create free account
hub / github.com/NVIDIA/stdexec / handle_edge_detection_request

Function handle_edge_detection_request

examples/server_theme/split_bulk.cpp:140–158  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

138}
139
140auto handle_edge_detection_request(http_request const & req) -> ex::sender auto
141{
142 // extract the input image from the request
143 ex::sender auto in_img_sender = ex::just(req) | ex::then(extract_image);
144
145 // Prepare for using multiple parallel flows on the same input sender
146 // ex::sender auto multi_shot_img = exec::split(in_img_sender);
147 auto& multi_shot_img = in_img_sender;
148
149 // Apply the three methods of edge detection on the same input image, in parallel.
150 // Then, join the results and generate the HTTP response
151 return ex::when_all(multi_shot_img | ex::then(apply_canny),
152 multi_shot_img | ex::then(apply_sobel),
153 multi_shot_img | ex::then(apply_prewitt))
154 |
155 // transform the resulting 3 images into an HTTP response
156 ex::then(img3_to_response);
157 // error and cancellation handling is performed outside
158}
159
160auto handle_multi_blur_request(http_request const & req) -> ex::sender auto
161{

Callers 1

mainFunction · 0.85

Calls 1

thenFunction · 0.85

Tested by

no test coverage detected