morristai commented on code in PR #3599:
URL:
https://github.com/apache/incubator-opendal/pull/3599#discussion_r1402939407
##########
core/src/types/list.rs:
##########
@@ -80,44 +92,77 @@ impl Stream for Lister {
return Poll::Ready(None);
}
- if let Some(fut) = self.stating.as_mut() {
- let (path, rp) = ready!(fut.poll_unpin(cx));
-
- // Make sure we will not poll this future again.
- self.stating = None;
- let metadata = match rp {
- Ok(rp) => rp.into_metadata(),
- Err(err) => {
+ if self.listing && self.task_queue.len() < self.task_queue.capacity() {
Review Comment:
Adopting `Option<Lister>` is a very wise solution. I learned a lot. Thank
you! 👍
##########
core/src/types/list.rs:
##########
@@ -80,44 +92,77 @@ impl Stream for Lister {
return Poll::Ready(None);
}
- if let Some(fut) = self.stating.as_mut() {
- let (path, rp) = ready!(fut.poll_unpin(cx));
-
- // Make sure we will not poll this future again.
- self.stating = None;
- let metadata = match rp {
- Ok(rp) => rp.into_metadata(),
- Err(err) => {
+ if self.listing && self.task_queue.len() < self.task_queue.capacity() {
Review Comment:
Adopting `Option<Lister>` is a very wise solution. I learned a lot. Thank
you! 👍
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]