I’m currently re-implementing our asynchronous background jobs using the Job Queue package.
In general it’s working like a charm but I have one scenario where it doesn’t seem to work (guess I’m just doing something wrong ;-))
I have a function that is called deferred. This function itself calls other functions in the same class that should be called deferred as well.
The functions that are called don’t return anything, are public and have the @Job\Defer annotation but they seem to be executed right away without creating an entry in the corresponding MySQL table (Job Queue Doctrine package).
I tried if it makes a difference if I don’t use $this->myFunction(); but rather inject the class and call $this->myClass->myFunction(); but the subsequent function calls still seem to be executed synchronously.
Is this supposed to work in general? If so do you guys have any idea what could be the problem?
thank you! That’s pretty much what I ended up doing and it works like a charm.
I also tried to build my own aspect without the check for recursion and noticed very fast that there’s a reason for it
If you remove that the aspect ends up creating new jobs in an endless loop since it never get’s to execute the actual function.