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

event: adding FeedOf[T] #24549

Closed
fjl opened this issue Mar 16, 2022 · 1 comment · Fixed by #26310
Closed

event: adding FeedOf[T] #24549

fjl opened this issue Mar 16, 2022 · 1 comment · Fixed by #26310

Comments

@fjl
Copy link
Contributor

fjl commented Mar 16, 2022

Package event provides type Feed for subscription handling. A Feed is always constrained to a single type, and this restriction is enforced at runtime using reflection. With the introduction of generics in Go 1.18, it is now possible to declare and enforce the element type of Feed at compile time.

To avoid breaking downstream code, I suggest we add a new type FeedOf[T any] to package event. The behavior of this feed implementation would be exactly the same as the current one.

@fjl
Copy link
Contributor Author

fjl commented Mar 16, 2022

Note for potential contributors: this issue is not actionable immediately since we will wait for a while to fully adopt Go 1.18 and generics. Please do not submit PRs for this issue right now.

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