Files
iroh/iroh-cli/src
Franz Heinzmann fc735026c7 feat: emit PendingContentReady event (#2302)
## Description

This adds a new `LiveEvent` variant: `PendingContentReady`.

It is emitted once, after sync was started, the list of pending content
blobs becomes empty. This is the case if either all blobs from this
sesion have been downloaded, or failed.

I think this could help with simple examples like
https://gist.github.com/dignifiedquire/efbd1a7a1da729494adb088d72f1ceaa#file-main-sync-rs-L84

It should not be used as a guarantee that all content is now available
locally, and it should be used with a timeout usually, because it may
very legally never be emitted (e.g. if the remote does not have all
blobs themselves, or closes the connections, etc).

## Breaking Changes

* `LiveEvent` now has a new variant `PendingContentReady`. This event is
emitted after a sync completed and `Self::SyncFinished` was emitted. It
signals that all currently pending downloads have been completed.
Receiving this event does not guarantee that all content in the document
is available. If blobs failed to download, this event will still be
emitted after all operations completed.


## Notes & open questions

<!-- Any notes, remarks or open questions you have to make about the PR.
-->

## Change checklist

- [x] Self-review.
- [x] Documentation updates if relevant.
- [ ] Tests if relevant.
- [x] All breaking changes documented.
2024-05-17 21:53:27 +00:00
..