File tree Expand file tree Collapse file tree 1 file changed +9
-0
lines changed
Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -241,6 +241,14 @@ namespace async_postgres::lua {
241241 lua->PushBool (false );
242242 return 1 ;
243243 }
244+
245+ lua_protected_fn (isBusy) {
246+ lua->CheckType (1 , async_postgres::connection_meta);
247+ auto state = lua_connection_state ();
248+ lua->PushBool (state->reset_event ||
249+ state->query ); // busy if reset or query are in progress
250+ return 1 ;
251+ }
244252} // namespace async_postgres::lua
245253
246254#define register_lua_fn (name ) \
@@ -263,6 +271,7 @@ void register_connection_mt(GLua::ILuaInterface* lua) {
263271 register_lua_fn (reset);
264272 register_lua_fn (setNotifyCallback);
265273 register_lua_fn (wait);
274+ register_lua_fn (isBusy);
266275
267276 async_postgres::register_misc_connection_functions (lua);
268277
You can’t perform that action at this time.
0 commit comments