I've tried this with crossbeam_channel, mpsc, and flume. From my view it looks like the receive side is never flushed. Below, I've cloned the sender and the receiver. Then reused the sender. The data in the receiver is still the first item in the channel even though I've done a rx1.recv().unwrap(). Am I doing something wrong or do I need a new channel each time?
fn main() {
let ip_route_dest = &[1, 3, 6, 1, 2, 1, 4, 21, 1, 1, ];
let ip_route_mask = &[1, 3, 6, 1, 2, 1, 4, 21, 1, 11, ];
let ip_route_next_hop = &[1, 3, 6, 1, 2, 1, 4, 21, 1, 7, ];
let ip_route_proto = &[1, 3, 6, 1, 2, 1, 4, 21, 1, 9, ];
let ip_route_age = &[1, 3, 6, 1, 2, 1, 4, 21, 1, 10, ];
let oids: &[&[u32]] = &[ip_route_dest,
ip_route_mask,
ip_route_next_hop,
ip_route_proto,
ip_route_age];
let (tx1, rx1) = flume::unbounded();
let (tx2, rx2) = (tx1.clone(), rx1.clone());
//let (tx3, rx3) = flume::unbounded();
let db = Pool::new("host=localhost user=fiostv password=fiostv");
let bgproute_initial_query = "SELECT * from multicast_bgproute";
db.db_channel(tx1, bgproute_initial_query);
let initial_query_results = rx1.recv().unwrap();
let query = "SELECT ip_address, community FROM multicast_contentdevices WHERE sysname LIKE '%VCCR%' LIMIT 3";
let mut agents = HashMap::new();
db.db_channel(tx2, query);
let query_results = rx2.recv().unwrap();