Hi everyone,
I am creating a job that does some potentially long-ish computation in a queue in the background. To that job I added an finish observer like this:
_job.ObservableFinished().AddObserver(ConcurrentGeneratorObjectData::WatchGeneratorFinished) iferr_ignore();
The _job
variable in this example is of type maxon::JobResultRef<BaseObject*>
.
The WatchGeneratorFinished()
observer function just fires an EventAdd()
when the job finishes, which is usually what I want. There are, however, certain events in the scene that I am listening to which indicate that this is not the behavior I want (e.g. an editor render being kicked off) in which case I would like to remove the observer (to potentially add it back again later). I did find a function ObservableBaseInterface::RemoveObserver()
, which appears to do what I want, but I am having a hard time finding out how to use it. The ObservableFinishedBase
object that is returned from JobResultRef<>::ObservableFinished()` function I am using does not seem to implement it. Is there a way for me to do this?
Any pointers very much appreciated!