[Server] Switched mpsc for crossbeam::channel.

This commit is contained in:
Acrimon
2019-08-16 00:10:46 +02:00
parent fda47fc322
commit 593deb828b
3 changed files with 7 additions and 9 deletions

View File

@ -25,16 +25,12 @@ use common::{
vol::Vox,
vol::{ReadVol, VolSize},
};
use crossbeam::channel;
use hashbrown::HashSet;
use log::debug;
use rand::Rng;
use specs::{join::Join, world::EntityBuilder as EcsEntityBuilder, Builder, Entity as EcsEntity};
use std::{
i32,
net::SocketAddr,
sync::{mpsc, Arc},
time::Duration,
};
use std::{i32, net::SocketAddr, sync::Arc, time::Duration};
use uvth::{ThreadPool, ThreadPoolBuilder};
use vek::*;
use world::{ChunkSupplement, World};
@ -65,8 +61,8 @@ pub struct Server {
clients: Clients,
thread_pool: ThreadPool,
chunk_tx: mpsc::Sender<(Vec2<i32>, (TerrainChunk, ChunkSupplement))>,
chunk_rx: mpsc::Receiver<(Vec2<i32>, (TerrainChunk, ChunkSupplement))>,
chunk_tx: channel::Sender<(Vec2<i32>, (TerrainChunk, ChunkSupplement))>,
chunk_rx: channel::Receiver<(Vec2<i32>, (TerrainChunk, ChunkSupplement))>,
pending_chunks: HashSet<Vec2<i32>>,
server_settings: ServerSettings,
@ -84,7 +80,7 @@ impl Server {
/// Create a new server bound to the given socket.
pub fn bind<A: Into<SocketAddr>>(addrs: A, settings: ServerSettings) -> Result<Self, Error> {
let (chunk_tx, chunk_rx) = mpsc::channel();
let (chunk_tx, chunk_rx) = channel::unbounded();
let mut state = State::default();
state