Closed ymoriaud closed 6 months ago
in general... would you rather limit the events that the leecher receives from aquarium or the evnts it dispatches?
Both are fine. The optimisation is minor, since topics are filtered in the callback.
But the callback function will grow based on #7, and to keep it readable and to split responsibilities, moving the "allowed_topics" outside the callback function will allow to only use the callback for checking the event context and sending the event into Ayon's database. Instead of having a big callback function doing a lots of stuff.
Does that seem logic to you ?
i think it's good.
using main()
for configuring the allowed event type coming from aquarium
using callback()
for filtering if the events belongs to an "ayon-synced" project
this is implemented as part of https://github.com/ynput/ayon-aquarium/pull/8
Closed by #8
The PR #2 added a list of allowed and ignored events' topic, to avoid unnecessary process. To limit the number of events that the leecher have to process, we can reuse the same list here:
https://github.com/ynput/ayon-aquarium/blob/ea0e891187e601675408219b7ae54157701666b3/services/leecher/leecher/leecher.py#L69
by something like that: