-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Make event_process = false
the default on derive(NetworkBehaviour)
#2190
Comments
It depends a bit what how the "reference architecture" of a rust-libp2p based application looks like. The approach you advocated for and also proposed in #2186 seems to be that the "libp2p part" of an application is abstracted behind a interface (the I think here is a bit of an architectural mismatch between the intended (historical) architecture, and what makes sense (as learned by some of the production users of rust-libp2p). Now, that being said, I personally very much favor abstracting the whole libp2p part of an application behind one interface, and handle everything in one giant event loop. That's why I wonder a bit, whether we shouldn't think about changing (or adding) the abstractions, rather than documenting historical complexity. (On a side note: #1947 is also motivated by that, offering an opinionated (and easy way) to just ship some bytes from/to a peer..) |
It is important to note that these approaches can be mixed and matched with each other. In my experience, starting with a flat composition of all your behaviours into one with As your application grows, so will the logic inside the eventloop. To stay on top of the complexity tyou can add layers of From this perspective, Whether or not you are using a |
Don't get me wrong, I agree with your proposal to make |
Got you! You might be interested in this discussion then :) |
👍 on |
With #2186, we are adding the until this day most-comprehensive example on how to use
rust-libp2p
.This example is using
event_process = false
to integrate nicely with an eventloop-based design.Back when it was added, we wanted to stay backwards compatible but at least in my view, setting
event_process
tofalse
deemed to be very useful and "idiomatic".Not having it the default is causing friction for users trying to follow our examples. (cc @whereistejas)
What are people's thoughts on making this the default with one of the next releases?
The text was updated successfully, but these errors were encountered: