Skip to content

Commit

Permalink
Reverted back TaskPool changes
Browse files Browse the repository at this point in the history
  • Loading branch information
BlackPhlox committed Nov 11, 2023
1 parent a584976 commit 41c6521
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 25 deletions.
20 changes: 9 additions & 11 deletions src/input.rs
Original file line number Diff line number Diff line change
Expand Up @@ -174,18 +174,16 @@ fn setup(mut commands: Commands, settings: Res<MidiInputSettings>) {
let (m_sender, m_receiver) = crossbeam_channel::unbounded::<Message>();
let (r_sender, r_receiver) = crossbeam_channel::unbounded::<Reply>();

//Got issues with the rewrite : https://github.com/bevyengine/bevy/pull/10008
//Got issues with the taskpool rewrite : https://github.com/bevyengine/bevy/pull/10008
let thread_pool = IoTaskPool::get_or_init(|| TaskPool::new());

Check failure on line 178 in src/input.rs

View workflow job for this annotation

GitHub Actions / Clippy

redundant closure

Check failure on line 178 in src/input.rs

View workflow job for this annotation

GitHub Actions / Clippy

redundant closure
thread_pool.scope(|s|{
s.spawn(async {
MidiInputTask {
receiver: m_receiver,
sender: r_sender,
settings: settings.clone(),
input: None,
connection: None,
}
})
thread_pool.spawn({
MidiInputTask {
receiver: m_receiver,
sender: r_sender,
settings: settings.clone(),
input: None,
connection: None,
}
});

commands.insert_resource(MidiInput {
Expand Down
15 changes: 1 addition & 14 deletions src/output.rs
Original file line number Diff line number Diff line change
Expand Up @@ -136,20 +136,8 @@ fn setup(mut commands: Commands, settings: Res<MidiOutputSettings>) {
let (m_sender, m_receiver) = crossbeam_channel::unbounded();
let (r_sender, r_receiver) = crossbeam_channel::unbounded();

//Got issues with the taskpool rewrite : https://github.com/bevyengine/bevy/pull/10008
let thread_pool = IoTaskPool::get_or_init(|| TaskPool::new());

Check failure on line 140 in src/output.rs

View workflow job for this annotation

GitHub Actions / Clippy

redundant closure

Check failure on line 140 in src/output.rs

View workflow job for this annotation

GitHub Actions / Clippy

redundant closure
thread_pool.scope(|s|{
s.spawn(async {
MidiOutputTask {
receiver: m_receiver,
sender: r_sender,
settings: settings.clone(),
output: None,
connection: None,
}
})
});
/*
let thread_pool = IoTaskPool::get();
thread_pool
.spawn(MidiOutputTask {
receiver: m_receiver,
Expand All @@ -159,7 +147,6 @@ fn setup(mut commands: Commands, settings: Res<MidiOutputSettings>) {
connection: None,
})
.detach();
*/

commands.insert_resource(MidiOutput {
sender: m_sender,
Expand Down

0 comments on commit 41c6521

Please sign in to comment.