Skip to content

Passing Python function to different Rust thread #3788

Answered by birkenfeld
marcpabst asked this question in Questions
Discussion options

You must be logged in to vote

You'll have to use GIL-independent objects, i.e. experiment_fn: Py<PyFunction>. In rust_experiment_fn, you then have to acquire the GIL before you can call experiment_fn.

Replies: 1 comment 8 replies

Comment options

You must be logged in to vote
8 replies
@adamreichold
Comment options

@marcpabst
Comment options

@adamreichold
Comment options

@davidhewitt
Comment options

@marcpabst
Comment options

Answer selected by marcpabst
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
4 participants