Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support owned iterators for GroupBy and IntoChunks into_iter() #500

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

Ten0
Copy link
Contributor

@Ten0 Ten0 commented Dec 2, 2020

Resolves #499

@jswrenn
Copy link
Member

jswrenn commented Jan 21, 2021

Thanks for the PR! I'm going to defer on reviewing it for a bit, since it appears to be a breaking change, and I want to focus on non-breaking PRs for the near-future.

@erichCompSci
Copy link

Hi, I see that this build failure has to do with how the Rust config is set up on the Travis CL continuous integration...but when I pull the offending branch and run locally, I can run the tests and there isn't a problem.

I want this functionality, but actually I want to increase it's capability to an Arc instead of an Rc because I want to use the chunking across an await in an asynchronous function. Still it would probably be good to get this implementation into the code first. Can you advise on how I can get this error on my local machine so I can fix it and send it back to you? Looking at your build statements, it looks like it the std::rc isn't being included in your cargo config possibly? However, when I pulled master mainline into this branch on my local distribution, I still couldn't get this compile error. So, how do I recreate your setup locally, what do I need to do?

@erichCompSci
Copy link

Okay, sorry, I delved a little bit more and then I found what commands were being run. I'll work on fixing it

@erichCompSci
Copy link

Okay, I fixed it and I can confirm that my one line change made this work and is not a breaking change. However, I am not the original committer. I'm not sure how we could proceed, can you please advise? I would like to get this into mainline if it's not a problem and then I would like to change this to ultimately make IntoChunks Sync and Send.

@Ten0
Copy link
Contributor Author

Ten0 commented May 2, 2021

Please send the fix and I'll look at it and most likely incorporate it in there. 🙂
However with regards to the Send/Sync change, how do you mean to deal with the Refcell? (which was already there iirc - hard to read quickly on my phone due to this crate not being rustfmt'ed.)

@erichCompSci
Copy link

erichCompSci commented May 3, 2021

Well, obviously Refcell has to go. You can't be Sync and have RefCell or Cell underneath the hood. Honestly, I need to play around with it a bit some more. Holding references across asyncs call is obviously a horrible idea and I'm still quite new to Pinning. However, I can use iterators across asyncs, so I'm confident a solution exists. I doubt it's a simple as moving to an Arc_Mutex (Couldn't write the < Mutex > for some reason) combination, but we will see. More than that, I know people will be sweating performance implications, so maybe it'd deserve it's own structs and function calls? Just general thoughts, should probably move this conversation somewhere more appropriate.

…Iter-alloc-fix

Switched the rc from std to alloc so that it'll compile when std is not available
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.

GroupBy and Chunks do not provide owned iterator versions
3 participants