ynput / ayon-kitsu

Official AYON<->Kitsu intetgration (WIP)
Apache License 2.0
7 stars 4 forks source link

Allow multiple services #18

Closed EmberLightVFX closed 5 months ago

EmberLightVFX commented 5 months ago

This PR prepares the service to be able to run multiple different services. It's needed for the next PR I'm working on to implement Gazu event listeners so Ayon will get the same kitsu sync as OpenPype.

Most updates in the code is inspired by the shotgrid code (https://github.com/ynput/ayon-shotgrid)

martastain commented 5 months ago

I see no problem with this PR itself (thanks for the clean-up), but I'm not convinced that the sync trigger justifies another service. The overhead of having two minimalistic services (not only computational but work required to set them up, keeping two separate images...) is pretty high - don't you think, we could just run the listener in another thread of the processor service? @iLLiCiTiT wdyt?

EmberLightVFX commented 5 months ago

Hmm, maybe. I was mostly looking on how the shotgrid addon. It has 3 different services. I don't see any problem running the sync-service and the current processor running from the same service. Maybe it's just cleaner code to have them separate? Ether way, this PR can still be nice to have for any future custom service-creation for Kitsu and what ever we decide for the sync-service (split or combined) that's for my next PR :)

iLLiCiTiT commented 5 months ago

don't you think, we could just run the listener in another thread of the processor service?

We have listener as separated service in ftrack so you can restart the processor service without loosing events which happened meanwhile the processor is restarting.

But if listener is not listening to "live" events, but is querying them, then it does not make sense and can be in single service.

EmberLightVFX commented 5 months ago

But if listener is not listening to "live" events, but is querying them, then it does not make sense and can be in single service.

The Gazu listeners executes a function when being called. It's possible to ether work "live" or if Ayon have a queue system we can use that. I rather go with the live approach as it's easier to move the code from OP to Ayon