Essentially I need a suggestion on a design here - not looking for an actual implementation. I need to create a class that will hold a queue that can be shared between multiple instances of other classes. The queue will hold jobs that need to be executed one by one. The user may add more jobs to the queue at any point. What would be a good approach here?
I know singletons are bad-ish so I'm not rushing to crete one however not really sure what's a good design in that case. Feels like creating a full blown service is a bit of an overkill especially that the queue will be used only to scheduling jobs that can be executed quite fast and the service asks for a lot of resources. I don't care that much if the app gets killed and the queue nullified.
Any suggestions? Thanks
Aucun commentaire:
Enregistrer un commentaire