File tree 2 files changed +4
-4
lines changed
2 files changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -103,7 +103,7 @@ pub struct Builder<M: ManageConnection> {
103
103
}
104
104
105
105
/// bb8's queue strategy when getting pool resources
106
- #[ derive( Debug ) ]
106
+ #[ derive( Debug , Clone , Copy ) ]
107
107
pub enum QueueStrategy {
108
108
/// First in first out
109
109
/// This strategy behaves like a queue
Original file line number Diff line number Diff line change 54
54
conns : VecDeque < IdleConn < M :: Connection > > ,
55
55
num_conns : u32 ,
56
56
pending_conns : u32 ,
57
- queue_strategy : QueueStrategy ,
58
57
}
59
58
60
59
impl < M > PoolInternals < M >
81
80
self . num_conns += 1 ;
82
81
}
83
82
83
+ let queue_strategy = pool. statics . queue_strategy ;
84
+
84
85
let mut guard = InternalsGuard :: new ( conn, pool) ;
85
86
while let Some ( waiter) = self . waiters . pop_front ( ) {
86
87
// This connection is no longer idle, send it back out
95
96
96
97
// Queue it in the idle queue
97
98
let conn = IdleConn :: from ( guard. conn . take ( ) . unwrap ( ) ) ;
98
- match self . queue_strategy {
99
+ match queue_strategy {
99
100
QueueStrategy :: Fifo => self . conns . push_back ( conn) ,
100
101
QueueStrategy :: Lifo => self . conns . push_front ( conn) ,
101
102
}
@@ -180,7 +181,6 @@ where
180
181
conns : VecDeque :: new ( ) ,
181
182
num_conns : 0 ,
182
183
pending_conns : 0 ,
183
- queue_strategy : QueueStrategy :: default ( ) ,
184
184
}
185
185
}
186
186
}
You can’t perform that action at this time.
0 commit comments