mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
[Server] Switched mpsc for crossbeam::channel.
This commit is contained in:
parent
fda47fc322
commit
593deb828b
1
Cargo.lock
generated
1
Cargo.lock
generated
@ -2970,6 +2970,7 @@ name = "veloren-server"
|
||||
version = "0.3.0"
|
||||
dependencies = [
|
||||
"chrono 0.4.7 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"crossbeam 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"hashbrown 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"lazy_static 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
|
@ -20,3 +20,4 @@ serde_derive = "1.0.98"
|
||||
rand = "0.7.0"
|
||||
chrono = "0.4.7"
|
||||
hashbrown = { version = "0.5.0", features = ["serde", "nightly"] }
|
||||
crossbeam = "0.7.2"
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user