Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: rough subscription manager API proposal #561

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ksedgwic
Copy link
Contributor

@ksedgwic ksedgwic commented Dec 9, 2024

No description provided.

@ksedgwic
Copy link
Contributor Author

I bet we could make the SubEndpoint a scoped object which automatically unsubscribes when it is dropped ...

@ksedgwic
Copy link
Contributor Author

I'm missing the outer flow on outbox ... is this right?:

  1. user clicks to view thread
  2. we one-time fetch k:10002 for author and determine authors relays
  3. we subscribe to the thread with SubConstraint::OutboxRelays(author_relays)
  4. SubMgr evaluates relays, possibly changes current set
  5. 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"

@ksedgwic
Copy link
Contributor Author

It might be useful to have a SubConstraint::Local which only queries local and doesn't alter remote subscriptions

@jb55
Copy link
Contributor

jb55 commented Dec 10, 2024

liking the sounds of this so far!

@ksedgwic ksedgwic force-pushed the 2024-12-submgr-sketch branch from 6edfa9c to a2f9e6c Compare December 10, 2024 23:19
@ksedgwic
Copy link
Contributor Author

  • 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> to calm rust re: the SubMgr reference issues ...

@ksedgwic ksedgwic force-pushed the 2024-12-submgr-sketch branch 3 times, most recently from e469fe3 to c5969bf Compare December 18, 2024 01:04
@ksedgwic ksedgwic force-pushed the 2024-12-submgr-sketch branch from c5969bf to e92e6ca Compare December 18, 2024 19:23
crates/notedeck/src/submgr.rs Outdated Show resolved Hide resolved
crates/notedeck/src/submgr.rs Outdated Show resolved Hide resolved
@ksedgwic ksedgwic force-pushed the 2024-12-submgr-sketch branch from e92e6ca to 084bd54 Compare December 19, 2024 00:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants