Skip to content

Commit

Permalink
Update to work with latest futures, tokio
Browse files Browse the repository at this point in the history
  • Loading branch information
asonix committed Mar 25, 2018
1 parent e47edc0 commit 619a455
Show file tree
Hide file tree
Showing 18 changed files with 121 additions and 101 deletions.
11 changes: 7 additions & 4 deletions Cargo.toml
@@ -1,15 +1,17 @@
[package]
name = "tokio-zmq"
description = "Provides Futures abstractions for ZeroMQ on the Tokio event-loop"
version = "0.4.0-alpha"
version = "0.4.0-beta"
license = "GPL-3.0"
authors = ["Riley Trautman <asonix.dev@gmail.com>"]
repository = "https://github.com/asonix/tokio-zmq"
readme = "README.md"
keywords = ["zmq", "zeromq", "futures", "tokio"]

[dependencies]
futures = "0.2.0-alpha"
futures-core = "0.2.0-beta"
futures-sink = "0.2.0-beta"
futures-util = "0.2.0-beta"
log = "0.4"
mio = "0.6"
tokio-file-unix = "0.4"
Expand All @@ -18,12 +20,13 @@ tokio-zmq-derive = { path = "tokio-zmq-derive", version = "0.4.0" }
zmq = "0.8"

[dependencies.tokio]
git = "https://github.com/tokio-rs/tokio.git"
version = "0.1"
features = [ "unstable-futures" ]

[dev-dependencies.tokio-executor]
git = "https://github.com/tokio-rs/tokio.git"
version = "0.1"
features = [ "unstable-futures" ]

[dev-dependencies]
env_logger = "0.4"
futures-channel = "0.2.0-beta"
6 changes: 3 additions & 3 deletions README.md
@@ -1,5 +1,5 @@
# Tokio ZMQ
_This readme is for the 0.4.0 alpha, for the 0.3.1 readme, look [here](https://github.com/asonix/tokio-zmq/tree/0.3.x)_
_This readme is for the 0.4.0 beta, for the 0.3.1 readme, look [here](https://github.com/asonix/tokio-zmq/tree/0.3.x)_

[documentation](https://docs.rs/tokio-zmq/)
[crates.io](https://crates.io/crates/tokio-zmq)
Expand All @@ -26,8 +26,8 @@ See the [examples folder](https://github.com/asonix/zmq-futures/tree/master/exam
Add the following to your Cargo.toml
```toml
zmq = "0.8"
tokio-zmq = "0.4.0-alpha"
futures = "0.2.0-alpha"
tokio-zmq = "0.4.0-beta"
futures = "0.2.0-beta"
tokio = "0.1"
```

Expand Down
8 changes: 4 additions & 4 deletions examples/dealer_router.rs
Expand Up @@ -20,7 +20,7 @@
#![feature(try_from)]

extern crate env_logger;
extern crate futures;
extern crate futures_util;
extern crate log;
extern crate tokio;
extern crate tokio_executor;
Expand All @@ -32,8 +32,8 @@ use std::env;
use std::sync::Arc;
use std::thread;

use futures::stream::iter_ok;
use futures::{FutureExt, StreamExt};
use futures_util::stream::iter_ok;
use futures_util::{FutureExt, StreamExt};
use tokio_zmq::prelude::*;
use tokio_zmq::{Dealer, Pub, Rep, Req, Router, Sub};
use tokio_zmq::{Multipart, Socket};
Expand Down Expand Up @@ -82,7 +82,7 @@ fn client() {
})
.and_then(move |(stream, _sink)| {
stream
.into_future()
.next()
.map_err(|(e, _)| e)
.and_then(|(maybe_last_item, _stream)| {
if let Some(multipart) = maybe_last_item {
Expand Down
7 changes: 4 additions & 3 deletions examples/load_balancing_broker.rs
Expand Up @@ -20,7 +20,8 @@
#![feature(try_from)]

extern crate env_logger;
extern crate futures;
extern crate futures_channel;
extern crate futures_util;
extern crate log;
extern crate tokio;
extern crate tokio_zmq;
Expand All @@ -32,8 +33,8 @@ use std::sync::Arc;
use std::thread;
use std::time::Duration;

use futures::{FutureExt, SinkExt, StreamExt};
use futures::channel::mpsc;
use futures_util::{FutureExt, SinkExt, StreamExt};
use futures_channel::mpsc;
use tokio_zmq::prelude::*;
use tokio_zmq::{Pub, Req, Router, Sub};
use tokio_zmq::{Multipart, Socket};
Expand Down
12 changes: 6 additions & 6 deletions examples/pull.rs
@@ -1,25 +1,25 @@
/*
* This file is part of ZeroMQ Futures.
* This file is part of Tokio ZMQ.
*
* Copyright © 2017 Riley Trautman
*
* ZeroMQ Futures is free software: you can redistribute it and/or modify
* Tokio ZMQ is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* ZeroMQ Futures is distributed in the hope that it will be useful,
* Tokio ZMQ is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with ZeroMQ Futures. If not, see <http://www.gnu.org/licenses/>.
* along with Tokio ZMQ. If not, see <http://www.gnu.org/licenses/>.
*/

#![feature(try_from)]

extern crate futures;
extern crate futures_util;
extern crate tokio;
extern crate tokio_executor;
extern crate tokio_zmq;
Expand All @@ -28,7 +28,7 @@ extern crate zmq;
use std::sync::Arc;
use std::convert::TryInto;

use futures::{FutureExt, StreamExt};
use futures_util::{FutureExt, StreamExt};
use tokio_zmq::prelude::*;
use tokio_zmq::{Pub, Pull, Sub};
use tokio_zmq::{Multipart, Socket};
Expand Down
12 changes: 6 additions & 6 deletions examples/pull_push.rs
@@ -1,33 +1,33 @@
/*
* This file is part of ZeroMQ Futures.
* This file is part of Tokio ZMQ.
*
* Copyright © 2017 Riley Trautman
*
* ZeroMQ Futures is free software: you can redistribute it and/or modify
* Tokio ZMQ is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* ZeroMQ Futures is distributed in the hope that it will be useful,
* Tokio ZMQ is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with ZeroMQ Futures. If not, see <http://www.gnu.org/licenses/>.
* along with Tokio ZMQ. If not, see <http://www.gnu.org/licenses/>.
*/

#![feature(try_from)]

extern crate futures;
extern crate futures_util;
extern crate tokio;
extern crate tokio_zmq;
extern crate zmq;

use std::sync::Arc;
use std::convert::TryInto;

use futures::{FutureExt, StreamExt};
use futures_util::{FutureExt, StreamExt};
use tokio_zmq::prelude::*;
use tokio_zmq::{Pull, Push, Sub};
use tokio_zmq::{Multipart, Socket};
Expand Down
14 changes: 7 additions & 7 deletions examples/push.rs
@@ -1,25 +1,25 @@
/*
* This file is part of ZeroMQ Futures.
* This file is part of Tokio ZMQ.
*
* Copyright © 2017 Riley Trautman
*
* ZeroMQ Futures is free software: you can redistribute it and/or modify
* Tokio ZMQ is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* ZeroMQ Futures is distributed in the hope that it will be useful,
* Tokio ZMQ is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with ZeroMQ Futures. If not, see <http://www.gnu.org/licenses/>.
* along with Tokio ZMQ. If not, see <http://www.gnu.org/licenses/>.
*/

#![feature(try_from)]

extern crate futures;
extern crate futures_util;
extern crate tokio;
extern crate tokio_timer_futures2 as tokio_timer;
extern crate tokio_zmq;
Expand All @@ -30,8 +30,8 @@ use std::sync::Arc;
use std::time::Duration;
use std::convert::TryInto;

use futures::{FutureExt, StreamExt};
use futures::stream::iter_ok;
use futures_util::{FutureExt, StreamExt};
use futures_util::stream::iter_ok;
use tokio_timer::{Timer, TimerError};
use tokio_zmq::prelude::*;
use tokio_zmq::{Error as ZmqFutError, Push, Socket};
Expand Down
12 changes: 6 additions & 6 deletions examples/rep.rs
@@ -1,26 +1,26 @@
/*
* This file is part of ZeroMQ Futures.
* This file is part of Tokio ZMQ.
*
* Copyright © 2017 Riley Trautman
*
* ZeroMQ Futures is free software: you can redistribute it and/or modify
* Tokio ZMQ is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* ZeroMQ Futures is distributed in the hope that it will be useful,
* Tokio ZMQ is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with ZeroMQ Futures. If not, see <http://www.gnu.org/licenses/>.
* along with Tokio ZMQ. If not, see <http://www.gnu.org/licenses/>.
*/

#![feature(try_from)]

extern crate env_logger;
extern crate futures;
extern crate futures_util;
extern crate log;
extern crate tokio;
extern crate tokio_zmq;
Expand All @@ -29,7 +29,7 @@ extern crate zmq;
use std::sync::Arc;
use std::convert::TryInto;

use futures::{FutureExt, StreamExt};
use futures_util::{FutureExt, StreamExt};
use tokio_zmq::prelude::*;
use tokio_zmq::{Rep, Socket};

Expand Down
14 changes: 7 additions & 7 deletions examples/req.rs
@@ -1,26 +1,26 @@
/*
* This file is part of ZeroMQ Futures.
* This file is part of Tokio ZMQ.
*
* Copyright © 2017 Riley Trautman
*
* ZeroMQ Futures is free software: you can redistribute it and/or modify
* Tokio ZMQ is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* ZeroMQ Futures is distributed in the hope that it will be useful,
* Tokio ZMQ is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with ZeroMQ Futures. If not, see <http://www.gnu.org/licenses/>.
* along with Tokio ZMQ. If not, see <http://www.gnu.org/licenses/>.
*/

#![feature(try_from)]

extern crate env_logger;
extern crate futures;
extern crate futures_util;
extern crate log;
extern crate tokio;
extern crate tokio_zmq;
Expand All @@ -29,8 +29,8 @@ extern crate zmq;
use std::sync::Arc;
use std::convert::TryInto;

use futures::{FutureExt, StreamExt};
use futures::stream::iter_ok;
use futures_util::{FutureExt, StreamExt};
use futures_util::stream::iter_ok;
use tokio_zmq::prelude::*;
use tokio_zmq::{Multipart, Req, Socket};

Expand Down
12 changes: 6 additions & 6 deletions examples/sub.rs
@@ -1,33 +1,33 @@
/*
* This file is part of ZeroMQ Futures.
* This file is part of Tokio ZMQ.
*
* Copyright © 2017 Riley Trautman
*
* ZeroMQ Futures is free software: you can redistribute it and/or modify
* Tokio ZMQ is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* ZeroMQ Futures is distributed in the hope that it will be useful,
* Tokio ZMQ is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with ZeroMQ Futures. If not, see <http://www.gnu.org/licenses/>.
* along with Tokio ZMQ. If not, see <http://www.gnu.org/licenses/>.
*/

#![feature(try_from)]

extern crate futures;
extern crate futures_util;
extern crate tokio;
extern crate tokio_zmq;
extern crate zmq;

use std::sync::Arc;
use std::convert::TryInto;

use futures::{FutureExt, StreamExt};
use futures_util::{FutureExt, StreamExt};
use tokio_zmq::prelude::*;
use tokio_zmq::{Socket, Sub};

Expand Down
6 changes: 3 additions & 3 deletions examples/sync_pubsub.rs
Expand Up @@ -20,7 +20,7 @@
#![feature(try_from)]

extern crate env_logger;
extern crate futures;
extern crate futures_util;
extern crate log;
extern crate tokio;
extern crate tokio_zmq;
Expand All @@ -31,8 +31,8 @@ use std::sync::Arc;
use std::thread;
use std::time::Duration;

use futures::stream::iter_ok;
use futures::{FutureExt, SinkExt, StreamExt};
use futures_util::stream::iter_ok;
use futures_util::{FutureExt, SinkExt, StreamExt};
use tokio_zmq::prelude::*;
use tokio_zmq::{Pub, Rep, Req, Sub};
use tokio_zmq::{Error, Multipart, Socket};
Expand Down

0 comments on commit 619a455

Please sign in to comment.