Skip to content
Closed
Show file tree
Hide file tree
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
1 change: 1 addition & 0 deletions implants/imix/src/agent.rs
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ impl<T: Transport + 'static> Agent<T> {
if self.handles[idx].is_finished() {
let mut handle = self.handles.remove(idx);
handle.report(&mut tavern).await?;
handle.join().await;
continue;
}

Expand Down
7 changes: 7 additions & 0 deletions implants/imix/src/task.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,13 @@ impl TaskHandle {
self.runtime.is_finished()
}

// Join all the JoinSets within the pool on the TaskHandle.
// WARNING: this will await until the entire pool is complete
// it is advised to check `is_finished` before calling this method.
pub async fn join(&mut self) {
while self.pool.join_next().await.is_some() {}
}

// Report any available task output.
// Also responsible for downloading any files requested by the eldritch runtime.
pub async fn report(&mut self, tavern: &mut (impl Transport + 'static)) -> Result<()> {
Expand Down
Loading