-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hi,
On 03/14/2014 03:17 PM, Joe Love wrote: > I'm looking to create a new event type, as I'd like to use the > postgresql async interface in an event-based manner. > > I know it could be done using a timer, and probe the active > connections. It seems silly to poll, when you can actually watch > the postgresql file descriptor (usually a socket) to see if there's > updates from an async call. > > So, what I'm looking to know: what's the most reasonable way to > extend libuv to add an interface like this? I'm figuring I can > base it off something like the tcp code. > > Or, if there's already a general interface for watching a socket, > given the socket id. I could utilize that as well. > If you have an arbitrary fd then you can just set it to be non-blocking and use a uv_poll_t handle to monitor its readability/writability. If it's a TCP socket you could put it in non-blocking mode and use uv_tcp_open, and then use the TCP api. Hope that helps! Cheers, - -- Saúl Ibarra Corretgé bettercallsaghul.com -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 Comment: Using GnuPG with Icedove - http://www.enigmail.net/ iQIcBAEBAgAGBQJTIxrmAAoJEEEOVVOum8BZk0sQAMpKgxMNvswnSWF27W2dzouD Gx1rsBnovotL+MfSsZi4icHwGoualeyNdL+bV92K45kPv4GYH4Es6c12R9LcpElL h4zSYg93NZemNdy82oR6y2t24o54/CZaw8Zl24/ORERqE0AISzwqPUXnwu99OZyw tHFlcZ7S5KLEIjzbXl9v646p5xkfKndcRfndRObuES8rYt/1KXnTE+maVTeLqF11 zjjjKneyT7jNYoIcBy+ZQAyuAafsu/3bX2hq6pBDOrQ97RrJXAJoVSifGZdDFxNJ ZTAD9CcLyg/rNTIOo3WYhCFI9X62E+zJTezY839y1FB5fXeVl2p1Tc+/iV2gK3fV TlcNwc0XAE3PdR91QzIkWPI/t2Lm8j06O1ev80m2W6j3PKrgSwnbPIgSiQ2RNACL cfPIDabHcWKCwdJxz+QzK2cSy66VIFe9N+UclaWoQdSe2GZNdqPvRkDvDbsQodjS eS0sz4/2UJuBhW7HzP1oXjTqL0DCMz3RqvIvQcoxWFvk6ftTSKYewt4B6MSn59Hv VC9HyNEowK9HlIj3Sm88sR9Z0LqSp8WxnJjdZZDL4Sihw2ogDcHW5NcK/Ln6Z62b qzpWPfuF+2WjTnZJhbCQdhrTACfez8L+4sWUUXV4LoJ2JraY9BuB+Zavz8InHCHC DRPWPvCnFeAJXWV5yulM =/JWk -----END PGP SIGNATURE----- -- You received this message because you are subscribed to the Google Groups "libuv" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/libuv. For more options, visit https://groups.google.com/d/optout.
