// GNU Lesser General Public License v3.0 // Copyright (c) 2025 Bart Beumer // // This program is free software; you can redistribute it and/or modify it // under the terms of the GNU Lesser General Public License v3.0 as published by // the Free Software Foundation. // #include using bmrshared::web::response_promise; response_promise::response_promise(callback_on_response cbOnResponse) : m_call_on_response(std::move(cbOnResponse)) { } response_promise::~response_promise() { if (m_response_writer) { m_call_on_response( [r = m_response_writer](boost::beast::tcp_stream& stream) { r->write_response(stream); }); } }