1.21 Gigawatts. Remove non-future indexing loop.

Tried to have a seperate futures loop but it's too confusign having
too write a Trait2, functon2, etc version of everything and keep it together.

Futures are functional sort of, so the synchronous versioun can be removed.
It still needs a ton of work though to be ready, or even get near the perf
of of the sync+rayon version.
This commit is contained in:
Jordan Petridis
2018-01-18 11:38:24 +02:00
parent 5d88998180
commit 93372a30d0
20 changed files with 246 additions and 292 deletions
+4
View File
@@ -15,3 +15,7 @@ glob = "0.2.11"
[dependencies.hammond-data]
path = "../hammond-data"
[dev-dependencies]
tokio-core = "0.1.12"
hyper-tls = "0.1.2"
+13 -5
View File
@@ -219,20 +219,28 @@ mod tests {
use hammond_data::Source;
use hammond_data::dbqueries;
use hyper::Client;
use hyper_tls::HttpsConnector;
use tokio_core::reactor::Core;
#[test]
// This test inserts an rss feed to your `XDG_DATA/hammond/hammond.db` so we make it explicit
// to run it.
#[ignore]
fn test_cache_image() {
let url = "http://www.newrustacean.com/feed.xml";
let mut core = Core::new().unwrap();
let client = Client::configure()
.connector(HttpsConnector::new(4, &core.handle()).unwrap())
.build(&core.handle());
let url = "http://www.newrustacean.com/feed.xml";
// Create and index a source
let mut source = Source::from_url(url).unwrap();
let source = Source::from_url(url).unwrap();
// Copy it's id
let sid = source.id();
// Convert Source it into a Feed and index it
let feed = source.into_feed(true).unwrap();
// Convert Source it into a future Feed and index it
let future = source.into_feed(&client, true);
let feed = core.run(future).unwrap();
feed.index().unwrap();
// Get the Podcast
+5
View File
@@ -13,3 +13,8 @@ extern crate tempdir;
pub mod downloader;
pub mod errors;
#[cfg(test)]
extern crate hyper_tls;
#[cfg(test)]
extern crate tokio_core;