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

stop() API and also an auto-stop logic when sbot closes #36

Open
staltz opened this issue Nov 9, 2022 · 6 comments
Open

stop() API and also an auto-stop logic when sbot closes #36

staltz opened this issue Nov 9, 2022 · 6 comments
Labels
could Nice to have in production

Comments

@staltz
Copy link
Member

staltz commented Nov 9, 2022

No description provided.

@staltz staltz added the should Needed in production label Nov 9, 2022
@Powersource
Copy link
Collaborator

@staltz

  1. what is stop() needed for?
  2. why is the auto-stop needed?
  3. do you have an example of how auto-stop should be implemented? it does auto stop in some sense at the moment, how should it be different?

@staltz
Copy link
Member Author

staltz commented Apr 27, 2023

@Powersource
Sorry, took me a while to filter my notifications and spot this one with questions for me.

what is stop() needed for?

start() automatically monitors add-member messages and will call reindexEncrypted, among other things. This is a heavy operation, and we should allow app developers to control when those operations can happen. stop() would let app developers control that.

why is the auto-stop needed?
do you have an example of how auto-stop should be implemented? it does auto stop in some sense at the moment, how should it be different?

auto-stop on sbot closing is necessary so we properly "clean up" instead of letting abrupt cancellations (which can cause either stdout/stderr warnings or may leave left overs in the filesystem, like LOCK files that leveldb some times generates). It's handy to make the auto-stop-on-closing a one line of code that just calls stop(), that's another reason to have stop().

Here's a few examples:

@Powersource
Copy link
Collaborator

@staltz thx!

Is this needed in production (the github label)?

@staltz
Copy link
Member Author

staltz commented May 2, 2023

Yeah, can label it for prod

@Powersource
Copy link
Collaborator

I mean can I remove the label?

@staltz
Copy link
Member Author

staltz commented May 3, 2023

Hmm, I guess it can be a could. Things might work in production without this, so that makes it a could.

@Powersource Powersource added could Nice to have in production and removed should Needed in production labels May 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
could Nice to have in production
Projects
None yet
Development

No branches or pull requests

2 participants