You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Realistically, there should only be a single event manager for each run of the library.
Making this a singleton will simplify the code, since we don't have to pass it to methods.
Also, this will make it easier for any method to do logging, since we don't need to change
the method signature and pass in the EventManager.
The text was updated successfully, but these errors were encountered:
I think this is not a good idea.
What if someone integrates openjpeg and another library also using openjpeg ?
Then there's a chance to receive messages from the wrong run or nothing at all.
IMHO, singleton are to be used very carefully and issues are almost never seen in basic testing which is mostly done with only one instance of the encoder/decoder running at any given time. Even in simpler case than what I mentioned, let's say multithreading on top of openjpeg with one message queue per thread, then this will be a nightmare.
Realistically, there should only be a single event manager for each run of the library.
Making this a singleton will simplify the code, since we don't have to pass it to methods.
Also, this will make it easier for any method to do logging, since we don't need to change
the method signature and pass in the EventManager.
The text was updated successfully, but these errors were encountered: