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

Documentation for AsyncQueue.IsCompleted is incorrect; should indicate it depends on whether the queue is emptp #1306

Closed
dpugh opened this issue Apr 29, 2024 · 0 comments · Fixed by #1316
Assignees
Milestone

Comments

@dpugh
Copy link

dpugh commented Apr 29, 2024

Bug description

The documentation for IsCompleted is "Gets a value indicating whether the queue has completed." which implies that it is determined by whether AsyncQueue.Complete() has been called.

The actual implementation seems to be:

    public bool IsCompleted
    {
        get
        {
            lock (SyncRoot)
            {
                return completeSignaled && IsEmpty;
            }
        }
    }

Which returns true if and only if the queue is completed and it is empty.

Changing the implementation at this point would be bad, but the documentation should be changed to something like:
"Gets a value indicating whether the queue has completed and empty."

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

Successfully merging a pull request may close this issue.

2 participants