Add ConnectionHandler::on_post_batch
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
#pragma once
|
||||
|
||||
#include <memory>
|
||||
#include <span>
|
||||
#include <string_view>
|
||||
|
||||
// Forward declaration to avoid circular dependency
|
||||
@@ -68,4 +69,17 @@ public:
|
||||
* @note May be called from an arbitrary accept thread.
|
||||
*/
|
||||
virtual void on_connection_closed(Connection &) {}
|
||||
|
||||
/**
|
||||
* @brief Called after a batch of connections has been processed.
|
||||
*
|
||||
* This hook is called after on_data_arrived or on_write_progress has been
|
||||
* called for each connection in the batch. The handler can take ownership of
|
||||
* the connections by moving the unique_ptr out of the span. Any connections
|
||||
* left in the span will remain owned by the server.
|
||||
*
|
||||
* @param batch A span of unique_ptrs to the connections in the batch.
|
||||
*/
|
||||
virtual void on_post_batch(std::span<std::unique_ptr<Connection>> /*batch*/) {
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user