|
Motion Master 6.0.0-alpha.86
Next-generation motion control software
|
Talks to one running auto-tuning process. More...
#include <client.h>
Public Member Functions | |
| Client (std::string baseUrl) | |
| Binds to a running process. | |
| std::expected< mm::net::Response, std::string > | run (const std::string &requestBody, std::chrono::seconds timeout=std::chrono::seconds{30}) const |
| Runs one function. | |
| std::expected< mm::net::Response, std::string > | spec () const |
| Fetches the program's own OpenAPI document. | |
| const std::string & | baseUrl () const |
| The address this client was built with. | |
Talks to one running auto-tuning process.
Stateless apart from the address, so all methods are safe to call from any thread. That is what the HTTP routes need: several requests may be in flight, and the program serves them concurrently.
|
inlineexplicit |
Binds to a running process.
| baseUrl | Root URL of the program's API, as Process::baseUrl reports it. |
|
inline |
The address this client was built with.
| std::expected< mm::net::Response, std::string > mm::auto_tuning::Client::run | ( | const std::string & | requestBody, |
| std::chrono::seconds | timeout = std::chrono::seconds{30} |
||
| ) | const |
Runs one function.
| requestBody | A JSON document with run and data. Passed through as text: this class neither builds nor validates it, because the program is the authority on what its functions accept and answers a bad request itself. |
| timeout | Whole-call limit. The default is far above what any function takes — measured against version 3.1.1, the slowest returns in 0.2 s — so it only fires when the program stops answering. |
| std::expected< mm::net::Response, std::string > mm::auto_tuning::Client::spec | ( | ) | const |
Fetches the program's own OpenAPI document.
This is the authority on the request and result shapes. Motion Master's own swagger.yml carries a copy of them, so that its generated clients are typed, and serving this alongside is what makes a drift between the two visible.