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

Dynamic multi-stage notifiers #52

Open
lemonsaurus opened this issue Feb 4, 2021 · 0 comments
Open

Dynamic multi-stage notifiers #52

lemonsaurus opened this issue Feb 4, 2021 · 0 comments
Labels
Milestone

Comments

@lemonsaurus
Copy link
Owner

lemonsaurus commented Feb 4, 2021

Currently, our notifiers only do a single thing - they notify when a job is done, and they do this at the end of the job.

For some notifiers, this is fine. For example, if we add an Email notifier, it makes sense to just send a single mail at the end of the job. However, for notifiers like Discord, we can do better than this. We can have the notifier dynamically update its progress as it progresses!

How would this look?

When blackbox starts up, the notifier sends its first message. It lists all the databases and all the storage methods, but shows all as pending, using 🟠 as the emoji.

image

Next, some of these will start, and the emoji changes to ♻️ (for collecting backup). When the backup has been collected and it starts uploading, it changes to ⬆️. Finally, it changes to ✅ when the process is complete. If it fails at any point, it changes to ⛔.

image
image

Yeah but, how do we do this?

I'm going to leave that up to you, but the basic idea will be something like this:

  • Instead of notifiers being called at the end of cli.py, they should probably be passed into the database and storage handler objects, and then called from inside the relevant methods.
  • We should support multiple simultaneous notifiers.
  • We need some way of tracking more granular states, and more emojis to correspond with each state.

I'm intentionally leaving the implementation details a bit vague, because it'll probably be easier if you have a bit of leeway on how to implement, and because it's an interesting challenge. Do chat with me on the lemonsaurus Discord if you'd like to discuss ideas for implementation, though.

@lemonsaurus lemonsaurus added this to the Dreamland milestone Mar 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant