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: add FeedOf[T] #26310

Merged
merged 1 commit into from
Dec 9, 2022
Merged

event: add FeedOf[T] #26310

merged 1 commit into from
Dec 9, 2022

Conversation

fjl
Copy link
Contributor

@fjl fjl commented Dec 5, 2022

This PR adds a new type event.FeedOf[T], which is like event.Feed but parameterized over the channel element type. Performance is unchanged, and it still uses reflect. But unlike Feed, the generic version doesn't need to type-check interface{} arguments. All panic cases are gone from the API.

Closes #24549

Performance is unchanged, and it still uses reflect. But all panic cases
are gone from the API.
@fjl
Copy link
Contributor Author

fjl commented Dec 8, 2022

To review this, it's probably best to diff event/feedof.go against event/feed.go.

Copy link
Contributor

@holiman holiman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@fjl fjl merged commit 3775e19 into ethereum:master Dec 9, 2022
@fjl fjl added this to the 1.11.0 milestone Dec 9, 2022
shekhirin pushed a commit to shekhirin/go-ethereum that referenced this pull request Jun 6, 2023
This PR adds a new type event.FeedOf[T], which is like event.Feed but parameterized
over the channel element type. Performance is unchanged, and it still uses reflect. But
unlike Feed, the generic version doesn't need to type-check interface{} arguments.
All panic cases are gone from the API.
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.

event: adding FeedOf[T]
2 participants