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

Migrating to futures::Stream for all iter_* method #295

Closed
wants to merge 7 commits into from

Conversation

YouKnow-sys
Copy link
Contributor

@YouKnow-sys YouKnow-sys commented Dec 20, 2024

In this PR I plan to rewrite all iter_* methods to use futures::Stream instead of manual iterator implementation.
Using futures::Stream could give us some very good advantages, for example there are tons of useful traits in futures that we can then use with our Stream's and its also overall a more standard way then what we are doing right now.

Todo:

  • iter_download => stream_download
  • iter_dialogs => stream_dialogs
  • iter_participants => stream_participants
  • iter_profile_photos => stream_profile_photos
  • iter_messages => stream_messages
  • search_messages => search_messages
  • search_all_messages => search_all_messages
  • Improve the overall code

Questions:

  1. should we really change the name of methods to stream_*? or is there better names
  2. should we re-export futures crate?
  3. using pin_mut macro everywhere doesn't seems like a good idea, what else should we do? should we implement custom future for lower level types?

took the data out of photo_size_data in `DownloadStream` instead of streaming
return size_hint when available from DialogStream
updated doctests
updated DEPS.md
added MessageStream and GlobalSearchStream
@Lonami
Copy link
Owner

Lonami commented Dec 20, 2024

Closing since all commits are now in master. Thanks.

@Lonami Lonami closed this Dec 20, 2024
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.

2 participants