Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update lapin-futures requirement to 0.11.1 #26

Merged
merged 2 commits into from
Apr 16, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@ dotenv = "0.11.0"
env_logger = "0.4.3"
futures = "0.1.17"
hyper = "^0.11"
lapin-async = "*"
lapin-futures = "0.10.0"
lapin-futures = "0.11.1"
log = "0.4.1"
schani_library_client = { git = "https://github.com/schani-rs/schani_library_client.git" }
schani_store_client = { git = "https://github.com/schani-rs/schani_store_client.git" }
Expand Down
5 changes: 2 additions & 3 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ extern crate dotenv;
extern crate env_logger;
extern crate futures;
extern crate hyper;
extern crate lapin_async;
extern crate lapin_futures as lapin;
#[macro_use]
extern crate log;
Expand Down Expand Up @@ -30,7 +29,7 @@ use futures::Future;
use hyper::Uri;
use schani_library_client::{Image, LibraryClient};
use schani_store_client::StoreClient;
use lapin_async::queue::Message;
use lapin::message::Delivery;
use tokio_core::reactor::Core;

struct Config {
Expand Down Expand Up @@ -68,7 +67,7 @@ pub fn run() {
let lib_client = Arc::new(LibraryClient::new(config.library_uri.clone(), &handle));
let store_client = Arc::new(StoreClient::new(config.store_uri.clone(), &handle));

queue::run(&host_addr, core, &|message: Message| {
queue::run(&host_addr, core, &|message: Delivery| {
info!("got message: {:?}", message);
let image_id = str::from_utf8(&message.data)
.unwrap()
Expand Down
4 changes: 2 additions & 2 deletions src/queue/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use std::thread;

use futures::{Future, Stream};
use lapin;
use lapin_async::queue::Message;
use lapin::message::Delivery;
use lapin::client::ConnectionOptions;
use lapin::types::FieldTable;
use lapin::channel::{BasicConsumeOptions, QueueDeclareOptions};
Expand All @@ -14,7 +14,7 @@ use tokio_core::net::TcpStream;
pub fn run(
addr: &net::SocketAddr,
mut core: Core,
fun: &Fn(Message) -> Box<Future<Item = Message, Error = io::Error>>,
fun: &Fn(Delivery) -> Box<Future<Item = Delivery, Error = io::Error>>,
) {
let work = TcpStream::connect(addr, &core.handle())
.and_then(|stream| {
Expand Down