Skip to content

Commit

Permalink
WIP:
Browse files Browse the repository at this point in the history
Added async-trait as an optional dep. For now, included only when
postgres is enabled.

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.
  • Loading branch information
thedodd committed Jan 31, 2020
1 parent 652f412 commit e851b66
Show file tree
Hide file tree
Showing 4 changed files with 200 additions and 122 deletions.
12 changes: 12 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion sqlx-core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ authors = [
[features]
default = [ "runtime-async-std" ]
unstable = []
postgres = [ "md-5", "sha2", "base64", "sha-1", "rand", "hmac" ]
postgres = [ "md-5", "sha2", "base64", "sha-1", "rand", "hmac", "async-trait" ]
mysql = [ "sha-1", "sha2", "generic-array", "num-bigint", "base64", "digest", "rand" ]
tls = [ "async-native-tls" ]
runtime-async-std = [ "async-native-tls/runtime-async-std", "async-std" ]
Expand All @@ -24,6 +24,7 @@ runtime-tokio = [ "async-native-tls/runtime-tokio", "tokio" ]
[dependencies]
async-native-tls = { version = "0.3.2", default-features = false, optional = true }
async-std = { version = "1.4.0", optional = true }
async-trait = { version = "0.1.22", optional = true }
tokio = { version = "0.2.9", default-features = false, features = [ "dns", "fs", "time", "tcp" ], optional = true }
async-stream = { version = "0.2.0", default-features = false }
base64 = { version = "0.11.0", default-features = false, optional = true, features = [ "std" ] }
Expand Down
Loading

0 comments on commit e851b66

Please sign in to comment.