| 417 | } |
| 418 | |
| 419 | void |
| 420 | queue_write(http::message_generator response) |
| 421 | { |
| 422 | // Allocate and store the work |
| 423 | response_queue_.push(std::move(response)); |
| 424 | |
| 425 | // If there was no previous work, start the write loop |
| 426 | if (response_queue_.size() == 1) |
| 427 | do_write(); |
| 428 | } |
| 429 | |
| 430 | // Called to start/continue the write-loop. Should not be called when |
| 431 | // write_loop is already active. |