Skip to content
Open
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
6 changes: 3 additions & 3 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -194,14 +194,14 @@ impl Runtime {
let mut threads = Vec::with_capacity(4);

for i in 0..4 {
let (evt_sender, evt_reciever) = channel::<Task>();
let (task_sender, task_reciever) = channel::<Task>();
let event_sender = event_sender.clone();

let handle = thread::Builder::new()
.name(format!("pool{}", i))
.spawn(move || {

while let Ok(task) = evt_reciever.recv() {
while let Ok(task) = task_reciever.recv() {
print(format!("recived a task of type: {}", task.kind));

if let ThreadPoolTaskKind::Close = task.kind {
Expand All @@ -219,7 +219,7 @@ impl Runtime {

let node_thread = NodeThread {
handle,
sender: evt_sender,
sender: task_sender,
};

threads.push(node_thread);
Expand Down