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

Add EventHandler trait to replace EventFn #346

Merged
merged 2 commits into from Aug 12, 2021

Conversation

a1phyr
Copy link
Contributor

@a1phyr a1phyr commented Aug 6, 2021

Replace EventFntrait with EventHandler.

The new trait has new capabilities but can be implemented for more types, such as channel receivers which are very commonly used.

Copy link
Member

@0xpr03 0xpr03 left a comment

Choose a reason for hiding this comment

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

Hi, can you rebase this onto the current master ? Other than that it seems fine, except for more documentation.

src/lib.rs Show resolved Hide resolved
@a1phyr
Copy link
Contributor Author

a1phyr commented Aug 8, 2021

Done

@0xpr03
Copy link
Member

0xpr03 commented Aug 12, 2021

Thanks! I'll add an example to the lib file. Maybe it'll be worth wile to add a tokio feature where we also implement this for async tokio channels. Problem is though, that we'll have to select between tokio::sync::broadcast and tokio::sync::watch or tokio::sync::mpsc.

@0xpr03 0xpr03 merged commit d7e2279 into notify-rs:main Aug 12, 2021
@a1phyr a1phyr deleted the event_handler branch May 27, 2022 14:21
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.

None yet

2 participants