status-im / nim-chronos

Chronos - An efficient library for asynchronous programming
https://status-im.github.io/nim-chronos/docs/chronos
Apache License 2.0
353 stars 51 forks source link

Future cleanup #393

Closed arnetheduck closed 1 year ago

arnetheduck commented 1 year ago
arnetheduck commented 1 year ago

This PR introduces some of the refactoring done in #373 to simplify discussion around it

cheatfate commented 1 year ago

If you want to be so strict about terms finished and completed - you should correct all the places where this terms are equal: For example:

  1. LogCompleteIndex should become LogFinishIndex because it records when Future become Finished and not only Completed.
  2. All the documentation comments we have in there are also using "finished == completed" term. For example https://github.com/status-im/nim-chronos/blob/2d82a4319ea34303096c428f50dd0c0d83c861a4/chronos/asyncfutures2.nim#L156-L158 or this one https://github.com/status-im/nim-chronos/blob/2d82a4319ea34303096c428f50dd0c0d83c861a4/chronos/asyncfutures2.nim#L170 Because after we merge this PR sentence "completed without error" will mean "completed without error without error".
arnetheduck commented 1 year ago

fixed: 777544a6270286759d036056a13f5b3f04d8ab8b