forked from pola-rs/polars
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(rust): Get polars to compile to wasm target (pola-rs#6050)
Co-authored-by: Kival Mahadew <kivalm@protonmail.com>
- Loading branch information
Showing
9 changed files
with
92 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
pub struct Pool; | ||
|
||
impl Pool { | ||
pub fn current_num_threads(&self) -> usize { | ||
rayon::current_num_threads() | ||
} | ||
|
||
pub fn install<OP, R>(&self, op: OP) -> R | ||
where | ||
OP: FnOnce() -> R + Send, | ||
R: Send, | ||
{ | ||
op() | ||
} | ||
|
||
pub fn join<A, B, RA, RB>(&self, oper_a: A, oper_b: B) -> (RA, RB) | ||
where | ||
A: FnOnce() -> RA + Send, | ||
B: FnOnce() -> RB + Send, | ||
RA: Send, | ||
RB: Send, | ||
{ | ||
rayon::join(oper_a, oper_b) | ||
} | ||
|
||
pub fn spawn<F>(&self, func: F) | ||
where | ||
F: 'static + FnOnce() + Send, | ||
{ | ||
rayon::spawn(func); | ||
} | ||
} |