Repository navigation
parse Postgres notifications; add method wait() to wait for them - #28
Merged
Merged
Conversation
Currently only notifications are supported.
Notices and parameter statuses are not implemented.
See also:
NOTIFY command
http://www.postgresql.org/docs/9.0/static/sql-notify.html
Asynchronous Operations:
http://www.postgresql.org/docs/9.1/static/protocol-flow.html
Protocol:
http://www.postgresql.org/docs/9.1/static/protocol-message-formats.html
It is needed to send 'listen channel' and 'unlisten channel' commands on a socket being read by another light thread in the same Lua handler. With reference to lua-nginx-module's documentation: > Starting from the 0.9.9 release, the cosocket object here is full-duplex, > that is, a reader "light thread" and a writer "light thread" can operate > on a single cosocket object simultaneously (both "light threads" must > belong to the same Lua handler though, see reasons above). But you cannot > have two "light threads" both reading (or writing or connecting) the same > cosocket, otherwise you might get an error like "socket busy reading" when > calling the methods of the cosocket object.
Owner
|
I'm worried about making the query interface confusing with more return values. If we want to return more information about a query (like notices), where would they go? What about putting the notifications, if we receive them, into the results object with a key |
Owner
|
also I updated |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.