notedeck
notedeck copied to clipboard
subman API
I bet we could make the SubEndpoint a scoped object which automatically unsubscribes when it is dropped ...
I'm missing the outer flow on outbox ... is this right?:
- user clicks to view thread
- we one-time fetch k:10002 for author and determine authors relays
- we subscribe to the thread with SubConstraint::OutboxRelays(author_relays)
- SubMgr evaluates relays, possibly changes current set
- user disposes of thread view, we remove subscription (and reevaluate relays)
OutboxRelays means "make sure we have at least one of these in our active set"
It might be useful to have a SubConstraint::Local which only queries local and doesn't alter remote subscriptions
liking the sounds of this so far!
- I force pushed the first commit, cleaning up the compiler comments etc
- the second commit makes the SubReceiver (was SubEndpoint) scoped and unsubscribes when it goes out scope.
Is the second commit a good thing? I used an Arc<Mutex<SubMgr>> to calm rust re: the SubMgr reference issues ...
Renamed to subman
rebased on master
not sure what these errors mean:
unknown_id_send: remote:f9a6ae99-0e26-4a21-9d09-d767309943a5: error: InternalError("trouble reading from rx_ended")
not sure what these errors mean:
good catch, that is not really an error, changed it to:
match rsub.rx_ended.next().await {
- Some(_) => Err(SubError::StreamEnded),
- None => Err(SubError::InternalError(
- "trouble reading from rx_ended".to_string(),
- )),
+ // in both cases the stream has ended
+ Some(_) => Err(SubError::StreamEnded), // an EOSE was observed
+ None => Err(SubError::StreamEnded), // the subscription was closed
}
@jb55 i added some error handling and relay pool handling improvements in the last three commits
rebased on master
rebased on master
why don't timelines use SubMan?
https://github.com/ksedgwic/notedeck/blob/f1aec8f6a21e89a7b4b97ebcdf1b6fa9389282df/crates/notedeck_columns/src/timeline/mod.rs#L581