| 2282 | } |
| 2283 | |
| 2284 | void RenderingController::Dispatch(std::function<void()> task) const |
| 2285 | { |
| 2286 | StorageThreadDispatcherBase::Pointer dispatcher; |
| 2287 | { |
| 2288 | std::lock_guard<std::mutex> lock(m_DispatcherMutex); |
| 2289 | dispatcher = m_Dispatcher.Lock(); |
| 2290 | } |
| 2291 | if (dispatcher.IsNull()) |
| 2292 | { |
| 2293 | task(); |
| 2294 | } |
| 2295 | else |
| 2296 | { |
| 2297 | dispatcher->Execute(std::move(task)); |
| 2298 | } |
| 2299 | } |
| 2300 | |
| 2301 | void RenderingController::SendErrorResponse(httplib::Response& res, int status, const nlohmann::json& error) const |
| 2302 | { |
no test coverage detected