Created
May 21, 2017 09:34
-
-
Save daboross/2a1ab943a16169a31987360d2731f797 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
messages_future.map(move |redis_msg| { | |
let lock = refs.lock(); | |
let res: u32 = lock.map(|subscriptions| { | |
subscriptions.get(&channel) | |
.map(|subscription| { | |
subscription.iter() | |
.cloned() | |
.map(|subscription_id| { | |
if redis_msg.channel_name == channel { | |
println!("subscription_id in map and msg {:?}", subscription_id); | |
println!("msg: {:?}", redis_msg); | |
active_subscriptions.get(&subscription_id) | |
.map(|on_message_closure| on_message_closure(&redis_msg.payload)); | |
}; | |
subscription_id | |
}) | |
.collect::<Vec<u32>>() | |
}) | |
// Ok(subscriptions) | |
}) | |
.unwrap() | |
.unwrap() | |
.first() | |
.map(|x| *x) | |
.unwrap(); | |
res | |
}) | |
.boxed() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment