craftytrickster / stubborn-io

io traits/structs for tokio that automatically recover from potential disconnections/interruptions
https://docs.rs/stubborn-io
MIT License
68 stars 17 forks source link

Allow for option to fail initial connect on startup, and to resolve Future anyway #34

Open craftytrickster opened 1 month ago

craftytrickster commented 1 month ago

Currently I support the following:

  1. Attempt to reconnect at startup until a success finally happens
  2. Fail immediately if first connection fails

This issue is to extend 1. The first option may sometimes be the desired behavior, however, the initial connect future will not resolve until at least one success happens. This may cause the StubbornIo/TCP to block an async task indefinitely, until it happens. There are use cases in which a user may want the connect Future to proceed, even though it did not successfully complete, since they know that it will continue to try to reconnect behind the scenes.