Conversation
|
Thank you for opening this. I'll try to review it this week and make it happen (sorry I'm not much into the PHP ecosystem these days, so it may take time). |
|
@praswicaksono Hi! Why weren't you happy with this decision? |
|
I know you opened this PR a long while ago. But can you make it easier for us to review by:
|
|
Hi! I did the 3 suggested steps in my own fork: https://github.com/crazy-weasel/roadrunner-bundle/tree/feat/implement-temporal
Before I create another pull request I want to be sure if that's okay, or if can be merged with this pr here. I'm not very active on GH and have no real experience with PRs. :) Also, there are some topics that I am not so sure about:
Thank your for any input, guidance and help on this. |
|
On further reading the code, I found nothing resetting the kernel or checking on doctrine. I guess that could added via the registerActivityFinalizer Method on the worker from the temporal SDK. Tomorrow I'll digg more into the code of the full bundle. |
|
Instead of using the activityFinalizer I created two ActivityInboundInterceptors, similar to the middlewares for the HttpWorker. One that is similar to the finally-block of the start-Method of HttpWorker, so that the reboot-strategies can also be used in the TemporalWorker. And one that mirrors the already existing DoctrineORMMiddleware. For that one I extracted the preRequest and postRequest-Methods in a trait to avoid duplicate code. The code for configuring those interceptors is already present in its current state in the PR, however, similar to the middleware for the HttpWorker, I believe this functionality should be built-in and not require implementation by the users of the bundle. I encountered an issue with an closed EntityManager. Only a call to managerRegistry->resetManager made it possible to use the EntityManager in further activities. I’m unsure how this is handled in HttpWorker, aside from what’s implemented in the middleware mentioned above. Feedback, some clarification or hints on where I could inform myself is very much welcome. :) Also, I’d love to know if you think my modifications fit well with the bundle. I plan to push my modifications to my fork tomorrow. I still need to clean up some changes I made to the configuration, but I wanted to share my findings so far. |
|
Hi again, I just pushed my changes to my fork - I can create a new pull-request for that, or is it possible to "merge" it with this one? I don't want to take away something away from praswicaksono. I solved the previously mentioned problems by registering the activities with a factory function that get's them form the container. Previously, the activities were stuck with old dependencies after a kernel-reboot, because the activities themselfs were built with the old container. There was no reliable way to update the dependencies of the TemporalWorker after a reboot, that's why I'll always get the dependencies directly from the container. Like with the other workers, I created a class that collects all dependencies for the TemporalWorker. The activities are provided by a service locator. I tried updating them by listening to the KernelRebooted-Event but for some reason that was not reliable. I think the inner workings of the worker from the temporal sdk are the reason for that. Looking forward to your feedback and instructions on what's the best way to integrate it with the already existing work. |
|
If you push your new changes to |
|
looks like I can't - I get an error 403 (afterall it's not my branch?) do you think there is a way around this? If there is a better way, I'd just repeat the work that I did (the rebase, and the modifications to the code) Or should I make a new pull-request? I checked, praswicaksono is still listed as an author in my branch. :) Sorry, if I made this to messy! |
|
Oh, sorry. I misread, You are not the author of that branch of course. Just open a new PR and you will be fine =) |
Integrate temporal worker and client. It detect if
temporal/sdkwas loaded it will enable integration. Here list following feature that have been done in this PRClient
Worker