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

Stream.fromQueue* could take a QueueSource instead of a Queue #2437

Closed
arosien opened this issue Jun 8, 2021 · 5 comments
Closed

Stream.fromQueue* could take a QueueSource instead of a Queue #2437

arosien opened this issue Jun 8, 2021 · 5 comments

Comments

@arosien
Copy link
Contributor

arosien commented Jun 8, 2021

I believe the signatures for Stream.fromQueueUnterminated, etc., could be narrowed to take QueueSource instead of Queue, because they only rely on the take and tryTake methods. Then if users want to translate a Queue to a Stream they don't have to require knowledge of the "write" methods of the Queue, only the "read" methods.

@kubukoz
Copy link
Member

kubukoz commented Jun 8, 2021

Agreed. I don't know if this will be a binary compatible change, though - if not, we can probably work around by making the existing functions package-private and adding new ones.

@djspiewak
Copy link
Member

Should be binary compatible since it's a contravariant parameter adjustment.

@armanbilge
Copy link
Member

Should be binary compatible since it's a contravariant parameter adjustment

I thought this too! But, MiMa didn't agree, I'd be really really interested to hear an explanation for why.

@mpilquist
Copy link
Member

@djspiewak These are static methods, not class methods.

@armanbilge
Copy link
Member

fromQueue is static, but the enqueue methods I also modified in my PR are class methods.

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

No branches or pull requests

5 participants