* 1) Test cases were not stopping AudioService before ending test case 2) Changed Audio to be a good singleton, previously because of Audio being bad singleton, test cases which were using static methods could have caused intermittent failures. 3) Made some other refactorings as well * Removed sonar issue and converted Audio to eager singleton for simplicity * Updated class diagram PNG
layout, title, folder, permalink, categories, tags
layout | title | folder | permalink | categories | tags | |||
---|---|---|---|---|---|---|---|---|
pattern | Event Queue | event-queue | /patterns/event-queue/ | Concurrency |
|
Intent
Event Queue is a good pattern if You have a limited accessibility resource (for example: Audio or Database), but You need to handle all the requests that want to use that. It puts all the requests in a queue and process them asynchronously. Gives the resource for the event when it is the next in the queue and in same time removes it from the queue.
Applicability
Use the Event Queue pattern when
- You have a limited accessibility resource and the asynchronous process is acceptable to reach that
Credits
- [Mihaly Kuprivecz - Event Queue] (http://gameprogrammingpatterns.com/event-queue.html)