Skip to content

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.
gzliudan added a commit to gzliudan/XDPoSChain that referenced this pull request Sep 19, 2025
gzliudan added a commit to gzliudan/XDPoSChain that referenced this pull request Sep 20, 2025
gzliudan added a commit to XinFinOrg/XDPoSChain that referenced this pull request Sep 21, 2025
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