Setting a module attribute from a function in a different module

Welcome to the forum!

The compiler will detect that you are calling a remote function on the Producer module and will compile the Producer module if it needs to. So yes, it’s a safe thing to do and quite a common pattern.