let us say I have a python 3.7+ module/script A which does extensive computations. Furthermore, module A is being used inside another module B, where module A is fully encapsulated and module B doesn't know a lot of module's A internal implementation, just that it somehow outputs the progress of its computation.
Consider me as the responsible person (person A) for module A, and anyone else (person B) that doesn't know me, is writing module B. So person A is writing basically an open library.
What would be the best way of module A to output its progress? I guess it's a design decision.

Would a getter in module A make sense so that module B has to always call this getter (maybe in a loop) in order to retrieve the progress of A?
Would it possible to somehow use a callback function which is implemented in module A in such a way that this function is called every time the progress updates? So that this callback returns the current progress of A.
Is there maybe any other approach to this that could be used?

Pointing me towards already existing solutions would be very helpful!
Essentially module B want to observe module A as it goes though extensive computation steps. And it is up to module A to decide how to compute progress and share this with module B. Module B can't compute progress as it doesn't know details of computation. So its is good use of observer pattern. Module A keeps notifying B about its progress. Form of progress update is also important. It can in terms of percentage, or "step 5 of 10" or time. It will actually define the notification payload structure with which module A will notify module B.
How to populate module internal progress status to another module?