Skip to content

Use appropriate context when iterating - #23

Open
itamarst wants to merge 1 commit into
mainfrom
18-inputs-dont-use-the-correct-context
Open

itamarst wants to merge 1 commit into
mainfrom
18-inputs-dont-use-the-correct-context

Conversation

@itamarst

Copy link
Copy Markdown
Collaborator

Fixes #18

@itamarst itamarst linked an issue Sep 17, 2026 that may be closed by this pull request
@itamarst
itamarst marked this pull request as ready for review September 17, 2026 20:03
@itamarst
itamarst requested a review from ngoldbaum September 17, 2026 20:03

@ngoldbaum ngoldbaum left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me, just one suggestion which avoids the mutex, which looks a little odd to me.

Comment thread src/lib.rs
// in the thread pool.
let iterator_driver = move || {
let orig_sender = sender.clone();
let result = Python::attach(move |iterating_py| {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is there a principled reason for the move here? If not I think if you delete it then iterator_driver would implement Fn and you wouldn't need the mutex below.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Inputs don't use the correct context

2 participants