github.com/onflow/flow-go@v0.35.7-crescendo-preview.23-atree-inlining/network/p2p/unicast/dialConfig.go (about)

     1  package unicast
     2  
     3  // Config is a struct that represents the dial config for a peer.
     4  type Config struct {
     5  	StreamCreationRetryAttemptBudget uint64 // number of times we have to try to open a stream to the peer before we give up.
     6  	ConsecutiveSuccessfulStream      uint64 // consecutive number of successful streams to the peer since the last time stream creation failed.
     7  }
     8  
     9  // UnicastConfigAdjustFunc is a function that is used to adjust the fields of a DialConfigEntity.
    10  // The function is called with the current config and should return the adjusted record.
    11  // Returned error indicates that the adjustment is not applied, and the config should not be updated.
    12  // In BFT setup, the returned error should be treated as a fatal error.
    13  type UnicastConfigAdjustFunc func(Config) (Config, error)