Close sessions in MaxScale core

The core now provides a simple function to close a session. This removes
the need for the modules to directly call the API entry points when the
session should be closed. It is also in line with the style that other
objects, namely the DCBs, use. This makes the new session_close very
similar to dcb_close.
This commit is contained in:
Markus Mäkelä
2017-03-13 22:56:18 +02:00
parent 29be8436e5
commit 7b3c287ac3
5 changed files with 50 additions and 90 deletions

View File

@ -324,6 +324,17 @@ static inline bool session_set_autocommit(MXS_SESSION* ses, bool autocommit)
*/
MXS_SESSION* session_get_by_id(int id);
/**
* @brief Close a session
*
* Calling this function will start the session shutdown process. The shutdown
* closes all related backend DCBs by calling the closeSession entry point
* of the router session.
*
* @param session The session to close
*/
void session_close(MXS_SESSION *session);
/**
* @brief Release a session reference
*