This also means all available channels can't be closed since we are waiting for processing events, this can lead to memory leaks for closed rooms.
To avoid this, we have to add an extra locking mechanism which should be ideally avoided.
Unfortunately implemenation has become more complicated than we thought because we also need to return the result of the async operation to the calling method i.e. attach, detach, release etc
Implementation doesn't sync with chat-js, which we have maintained till now. We need to introduce additional interfaces. If time comes, it will be a bit difficult to correlate both codebases.
I am not biased towards any kind of implementation, but rather toward simplicity, readability, and usability and how better it aligns with the spec.
Few concerns
subscribeToJobEvents
method which starts a while loop that should run indefinitely, even after room release.I am not biased towards any kind of implementation, but rather toward simplicity, readability, and usability and how better it aligns with the spec.