Open mecampbellsoup opened 2 years ago
The socket initialization is a bit confusing at the moment, but I think the best approach would be to provide a new sock_type
option to the constructor that instructs the HAProxy module to be used.
The socket initialization is a bit confusing at the moment, but I think the best approach would be to provide a new
sock_type
option to the constructor that instructs the HAProxy module to be used.
You mean this constructor (of the TCP socket) right?
You mean this constructor (of the TCP socket) right?
There's already a socket_type
argument passed to the constructor AFAICT.
Description
We are using pgmoon inside of HAProxy Lua to connect to our Postgres DB server, make queries, establish
LISTEN
pgnotify clients, etc.However the standard Lua Socket class is blocking as you can see from the source code.
TODO: describe the blocking nature of
luasocket
more clearly aboveFrom an HAProxy blog post:
As such we forked
pgmoon
and simply replacedluasocket
with HAProxy's non-blocking Lua Socket class.We'd like to discuss how to get his merged upstream so that others can benefit and we can get back onto using a non-forked pgmoon implementation.
I'll open a PR and link it to this issue with our naive implementation but we'd like to hear thoughts/suggestions on getting this feature merged.
Merry X-mas @leafo! 😄
cc @kriscode1