swoole_mysql->on

设置事件回调函数。目前仅支持onClose事件回调。

function swoole_mysql->on($event_name, callable $callback);

onClose事件

当连接关闭时回调此函数。

$db->on('Close', function($db){
	echo "MySQL connection is closed.\n";
});