Skip to content

Commit e52dc09

Browse files
iostatrusscam
authored andcommitted
Implement Sync and Send on ConnectionPool (#49)
This commit implements Sync and Send for ConnectionPool, so that one can .spawn() futures that use the client.
1 parent e74bbae commit e52dc09

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

elasticsearch/src/http/transport.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ impl TransportBuilder {
8585
/// from which [Connection]s to Elasticsearch will be retrieved.
8686
pub fn new<P>(conn_pool: P) -> Self
8787
where
88-
P: ConnectionPool + Debug + Clone + 'static,
88+
P: ConnectionPool + Debug + Clone + Send + 'static,
8989
{
9090
Self {
9191
client_builder: reqwest::ClientBuilder::new(),
@@ -303,7 +303,7 @@ impl Default for Transport {
303303
/// to get the next [Connection]. The simplest type of [ConnectionPool] is [SingleNodeConnectionPool],
304304
/// which manages only a single connection, but other implementations may manage connections more
305305
/// dynamically at runtime, based upon the response to API calls.
306-
pub trait ConnectionPool: Debug + dyn_clone::DynClone {
306+
pub trait ConnectionPool: Debug + dyn_clone::DynClone + Sync + Send {
307307
/// Gets a reference to the next [Connection]
308308
fn next(&self) -> &Connection;
309309
}

0 commit comments

Comments
 (0)