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

Function handle_classify_request

examples/server_theme/then_upon.cpp:168–186  ·  view source on GitHub ↗

Handler for the "classify" request type

Source from the content-addressed store, hash-verified

166
167// Handler for the "classify" request type
168auto handle_classify_request(http_request const & req) -> ex::sender auto
169{
170 return
171 // start with the input buffer
172 ex::just(req)
173 // extract the image from the input request
174 | ex::then(extract_image)
175 // analyze the content of the image and classify it
176 // we are doing the processing on the same thread
177 | ex::then(do_classify)
178 // handle errors
179 | ex::upon_error(on_classification_error)
180 // handle cancellation
181 | ex::upon_stopped(on_classification_cancelled)
182 // transform this into a response
183 | ex::then(to_response)
184 // done
185 ;
186}
187
188auto main() -> int
189{

Callers 1

mainFunction · 0.85

Calls 1

thenFunction · 0.85

Tested by

no test coverage detected