| 804 | } |
| 805 | |
| 806 | static int dbconsumer_poll(Lua L) |
| 807 | { |
| 808 | dbconsumer_t *q = luaL_checkudata(L, 1, dbtypes.dbconsumer); |
| 809 | lua_Number arg = luaL_checknumber(L, 2); |
| 810 | lua_Integer delay_ms; // ms |
| 811 | lua_number2integer(delay_ms, arg); |
| 812 | if (delay_ms < 0) { |
| 813 | delay_ms = 0; |
| 814 | } |
| 815 | int rc = dbq_poll(L, q, delay_ms); |
| 816 | if (rc >= 0) { |
| 817 | return rc; |
| 818 | } |
| 819 | return luaL_error(L, getsp(L)->error); |
| 820 | } |
| 821 | |
| 822 | static inline int push_and_return(Lua L, int rc) |
| 823 | { |
nothing calls this directly
no test coverage detected