The basic PgListener stream impl now yields `Result<PgNotification>`
elements without an `Option` in the result. The option condition
originally represented the closure of the underlying connection. Now
such conditions will terminate the stream, as one would expect. The
`PgListener.recv()` method signature has not been changed.
PgPoolListener has also been updated. The interfaces on this struct will
never yield an inner `Option` as it will instead acquire a new
connection and continue its work. Both the stream impl & the `recv`
method have received an update to their signatures.
Broke up PgListener into two types. PgListener for basic one-off
connections, and PgPoolListener for the listener created from the
PgPool.
The API is a bit more clear now with this change in terms of reconnect
behavior and the like.
Update `fn stream` to be `fn into_stream`, as that nomenclature is a bit
more normative in the Rust ecosystem.
Extension traits are now being used for PgConnection, PgPoolConnection &
PgPool for listen/notify functionality. Only two extension traits were
introduced.
Only a single trait method is present on the extension traits and it
works for single or multi channel listening setups.
Automatic reconnect behavior is implemented for PgPool based listeners.
All logic has been cut over to the `recv` impls for the PgListener
variants.
Use async-stream for a nice Stream interface.
This changeset introduces an interface for using PostgreSQL's LISTEN
functionality from within sqlx.
The listen interface is implemented over the PgConnection, PgPool & the
PgPoolConnection types for ease of use. In the case of PgPool, a new
connection is acquired, and is then used for LISTEN functionality.
Closes#87