Skip to content

Commit

Permalink
use crossbeam-queue instead of crossbeam (zeromq#166)
Browse files Browse the repository at this point in the history
Signed-off-by: Andrew Whitehead <[email protected]>

Signed-off-by: Andrew Whitehead <[email protected]>
Co-authored-by: John Law <[email protected]>
  • Loading branch information
andrewwhitehead and poyea authored Aug 14, 2022
1 parent 48e9ef4 commit 6ca89ef
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ tokio-util = { version = "0.7", features = ["compat"], optional = true }
num-traits = "0.2"
enum-primitive-derive = "0.2"
dashmap = "5"
crossbeam = "0.7"
crossbeam-queue = "0.3"
uuid = { version = "1", features = ["v4"] }
regex = "1"
once_cell = "1"
Expand Down
6 changes: 3 additions & 3 deletions src/backend.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use crate::{
MultiPeerBackend, SocketBackend, SocketEvent, SocketOptions, SocketType, ZmqError, ZmqResult,
};
use async_trait::async_trait;
use crossbeam::queue::SegQueue;
use crossbeam_queue::SegQueue;
use dashmap::DashMap;
use futures::channel::mpsc;
use futures::SinkExt;
Expand Down Expand Up @@ -49,8 +49,8 @@ impl GenericSocketBackend {
// we don't have a matching peer in peers map
loop {
let next_peer_id = match self.round_robin.pop() {
Ok(peer) => peer,
Err(_) => match message {
Some(peer) => peer,
None => match message {
Message::Greeting(_) => panic!("Sending greeting is not supported"),
Message::Command(_) => panic!("Sending commands is not supported"),
Message::Message(m) => {
Expand Down
6 changes: 3 additions & 3 deletions src/req.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ use crate::{SocketType, ZmqResult};

use async_trait::async_trait;
use bytes::Bytes;
use crossbeam::queue::SegQueue;
use crossbeam_queue::SegQueue;
use dashmap::DashMap;
use futures::{SinkExt, StreamExt};
use std::collections::HashMap;
Expand Down Expand Up @@ -49,8 +49,8 @@ impl SocketSend for ReqSocket {
// we don't have a matching peer in peers map
loop {
let next_peer_id = match self.backend.round_robin.pop() {
Ok(peer) => peer,
Err(_) => {
Some(peer) => peer,
None => {
return Err(ZmqError::ReturnToSender {
reason: "Not connected to peers. Unable to send messages",
message,
Expand Down
2 changes: 1 addition & 1 deletion src/sub.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ use crate::fair_queue::FairQueue;
use crate::fair_queue::QueueInner;
use async_trait::async_trait;
use bytes::{BufMut, BytesMut};
use crossbeam::queue::SegQueue;
use crossbeam_queue::SegQueue;
use dashmap::DashMap;
use futures::channel::mpsc;
use futures::{SinkExt, StreamExt};
Expand Down

0 comments on commit 6ca89ef

Please sign in to comment.