|
@@ -18,8 +18,6 @@ use config::SessionConfig;
|
|
use audio_key::AudioKeyManager;
|
|
use audio_key::AudioKeyManager;
|
|
use channel::ChannelManager;
|
|
use channel::ChannelManager;
|
|
use mercury::MercuryManager;
|
|
use mercury::MercuryManager;
|
|
-use metadata::MetadataManager;
|
|
|
|
-use audio_file::AudioFileManager;
|
|
|
|
|
|
|
|
pub struct SessionData {
|
|
pub struct SessionData {
|
|
country: String,
|
|
country: String,
|
|
@@ -33,10 +31,8 @@ pub struct SessionInternal {
|
|
tx_connection: mpsc::UnboundedSender<(u8, Vec<u8>)>,
|
|
tx_connection: mpsc::UnboundedSender<(u8, Vec<u8>)>,
|
|
|
|
|
|
audio_key: Lazy<AudioKeyManager>,
|
|
audio_key: Lazy<AudioKeyManager>,
|
|
- audio_file: Lazy<AudioFileManager>,
|
|
|
|
channel: Lazy<ChannelManager>,
|
|
channel: Lazy<ChannelManager>,
|
|
mercury: Lazy<MercuryManager>,
|
|
mercury: Lazy<MercuryManager>,
|
|
- metadata: Lazy<MetadataManager>,
|
|
|
|
cache: Option<Arc<Cache>>,
|
|
cache: Option<Arc<Cache>>,
|
|
|
|
|
|
handle: Remote,
|
|
handle: Remote,
|
|
@@ -62,6 +58,7 @@ impl Session {
|
|
{
|
|
{
|
|
let access_point = apresolve_or_fallback::<io::Error>(&handle);
|
|
let access_point = apresolve_or_fallback::<io::Error>(&handle);
|
|
|
|
|
|
|
|
+
|
|
let handle_ = handle.clone();
|
|
let handle_ = handle.clone();
|
|
let connection = access_point.and_then(move |addr| {
|
|
let connection = access_point.and_then(move |addr| {
|
|
info!("Connecting to AP \"{}\"", addr);
|
|
info!("Connecting to AP \"{}\"", addr);
|
|
@@ -114,10 +111,8 @@ impl Session {
|
|
cache: cache.map(Arc::new),
|
|
cache: cache.map(Arc::new),
|
|
|
|
|
|
audio_key: Lazy::new(),
|
|
audio_key: Lazy::new(),
|
|
- audio_file: Lazy::new(),
|
|
|
|
channel: Lazy::new(),
|
|
channel: Lazy::new(),
|
|
mercury: Lazy::new(),
|
|
mercury: Lazy::new(),
|
|
- metadata: Lazy::new(),
|
|
|
|
|
|
|
|
handle: handle.remote().clone(),
|
|
handle: handle.remote().clone(),
|
|
|
|
|
|
@@ -139,10 +134,6 @@ impl Session {
|
|
self.0.audio_key.get(|| AudioKeyManager::new(self.weak()))
|
|
self.0.audio_key.get(|| AudioKeyManager::new(self.weak()))
|
|
}
|
|
}
|
|
|
|
|
|
- pub fn audio_file(&self) -> &AudioFileManager {
|
|
|
|
- self.0.audio_file.get(|| AudioFileManager::new(self.weak()))
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
pub fn channel(&self) -> &ChannelManager {
|
|
pub fn channel(&self) -> &ChannelManager {
|
|
self.0.channel.get(|| ChannelManager::new(self.weak()))
|
|
self.0.channel.get(|| ChannelManager::new(self.weak()))
|
|
}
|
|
}
|
|
@@ -151,10 +142,6 @@ impl Session {
|
|
self.0.mercury.get(|| MercuryManager::new(self.weak()))
|
|
self.0.mercury.get(|| MercuryManager::new(self.weak()))
|
|
}
|
|
}
|
|
|
|
|
|
- pub fn metadata(&self) -> &MetadataManager {
|
|
|
|
- self.0.metadata.get(|| MetadataManager::new(self.weak()))
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
pub fn spawn<F, R>(&self, f: F)
|
|
pub fn spawn<F, R>(&self, f: F)
|
|
where F: FnOnce(&Handle) -> R + Send + 'static,
|
|
where F: FnOnce(&Handle) -> R + Send + 'static,
|
|
R: IntoFuture<Item=(), Error=()>,
|
|
R: IntoFuture<Item=(), Error=()>,
|