// Since publishers are temporarily upgraded to owners during the
// actual publish but are not the ones that handle cleanup, we simply
// wait until there are no other owners in the cleanup procedure. The
// next time a publisher wants to publish they will fail because the
// value in the Arc has been dropped. Hacky but works.
Since publishers are temporarily upgraded to owners during the
actual publish but are not the ones that handle cleanup, we simply
wait until there are no other owners in the cleanup procedure. The
next time a publisher wants to publish they will fail because the
value in the Arc has been dropped. Hacky but works.
Since publishers are temporarily upgraded to owners during the actual publish but are not the ones that handle cleanup we simply wait until there are no other owners in the cleanup procedure . The next time a publisher wants to publish they will fail because the value in the Arc has been dropped . Hacky but works .
fn wait_until_unwrapped<T>(mut a: Arc<T>) -> T
where
    T: std::fmt::Debug,
{
    loop {
        match Arc::try_unwrap(a) {
            Ok(b) => return b,
            Err(t) => a = t,
        }
    }
}
fn wait_until_unwrapped < T > ( mut a : Arc < T > ) -> T where T : std :: fmt :: Debug , { loop { match Arc :: try_unwrap ( a ) { Ok ( b ) => return b , Err ( t ) => a = t , } } }
Since publishers are temporarily upgraded to owners during the
actual publish but are not the ones that handle cleanup, we simply
wait until there are no other owners in the cleanup procedure.
Since publishers are temporarily upgraded to owners during the actual publish but are not the ones that handle cleanup we simply wait until there are no other owners in the cleanup procedure .
a
Arc<T>