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

swarm-derive/: Do not default out_event to () when event_process=false #2373

Closed
mxinden opened this issue Dec 8, 2021 · 1 comment
Closed
Labels
difficulty:moderate getting-started Issues that can be tackled if you don't know the internals of libp2p very well help wanted

Comments

@mxinden
Copy link
Member

mxinden commented Dec 8, 2021

By default the NetworkBehaviour derive macro out_event attribute is (). This makes sense when the event_process attribute is set to true, though with #2214 the NetworkBehaviour derive macro event_process attribute is false by default. Not processing the event (event_process=false) and setting an empty out event (()) defeats the purpose of the event mechanism of the NetworkBehaviour trait.

I suggest requiring a user to set out_event to a custom enum when event_process is false.

This has been raised by @thomaseizinger in #2361 (comment).

@thomaseizinger
Copy link
Contributor

We now automatically generate the out event.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
difficulty:moderate getting-started Issues that can be tackled if you don't know the internals of libp2p very well help wanted
Projects
None yet
Development

No branches or pull requests

2 participants