summaryrefslogtreecommitdiffstats
path: root/ipfs-api/examples/ping_peer.rs
diff options
context:
space:
mode:
authorSameer Puri <sameer@users.noreply.github.com>2019-02-09 14:34:00 -0600
committerSameer Puri <sameer@users.noreply.github.com>2019-02-13 18:29:04 -0600
commit4bdebbf4d1d1edb839eba860b013e3fdb870f66e (patch)
tree965a5a80b387c0eb719ca568a96a729d9d3f2ade /ipfs-api/examples/ping_peer.rs
parentf125fdbde329095419630e02ebf33d2c73aeced7 (diff)
Add actix feature for using actix-web
Diffstat (limited to 'ipfs-api/examples/ping_peer.rs')
-rw-r--r--ipfs-api/examples/ping_peer.rs11
1 files changed, 11 insertions, 0 deletions
diff --git a/ipfs-api/examples/ping_peer.rs b/ipfs-api/examples/ping_peer.rs
index 1d32210..c60e895 100644
--- a/ipfs-api/examples/ping_peer.rs
+++ b/ipfs-api/examples/ping_peer.rs
@@ -6,7 +6,10 @@
// copied, modified, or distributed except according to those terms.
//
+#[cfg(feature = "actix")]
+extern crate actix_web;
extern crate futures;
+#[cfg(feature = "hyper")]
extern crate hyper;
extern crate ipfs_api;
@@ -59,5 +62,13 @@ fn main() {
})
.map_err(|e| eprintln!("{}", e));
+ #[cfg(feature = "hyper")]
hyper::rt::run(req);
+ #[cfg(feature = "actix")]
+ actix_web::actix::run(|| {
+ req.then(|_| {
+ actix_web::actix::System::current().stop();
+ Ok(())
+ })
+ });
}