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

Streaming search that returns a stream #14

Closed
StarlessNights opened this issue Oct 9, 2024 · 1 comment · Fixed by #15
Closed

Streaming search that returns a stream #14

StarlessNights opened this issue Oct 9, 2024 · 1 comment · Fixed by #15
Assignees

Comments

@StarlessNights
Copy link

StarlessNights commented Oct 9, 2024

First of this looks like a real nice project! There is certainly room for an abstraction over ldap3 (which I'm using currently).

Is your feature request related to a problem? Please describe.

I want to execute a steaming search and "process" the individual results asynchronously. I'm expecting the search results to be big, so I don't want to store it in memory all at once.

Describe the solution you'd like

streaming_search should return a stream instead of a vector containing all the results.
In practice it would be a wrapper object around ldap3::SearchStream that implements the stream trait.
SearchStream already takes care of the pagination, so probably this could be done with very little logic here.

Describe alternatives you've considered

The same thing could be done upstream in the ldap3 crate, but probably they just want to mirror the LDAP protocol more closely in their API.

Additional context

It would still be relatively simple to just collect the stream into a Vec if the user just wants all the results at once.

@keaz keaz self-assigned this Oct 9, 2024
@keaz keaz added this to Simple Ldap Oct 9, 2024
@keaz keaz linked a pull request Oct 9, 2024 that will close this issue
@keaz
Copy link
Owner

keaz commented Oct 9, 2024

@StarlessNights, Thank you for your feature request. Please review the PR #15

@keaz keaz closed this as completed in #15 Oct 29, 2024
@github-project-automation github-project-automation bot moved this from In Progress to Done in Simple Ldap Oct 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

2 participants