Callback with replicator

I have implemented my own camera signal class that collects frame data (rgb and segmented) and adds it to a queue.

Now, I want to call my own function that collects the annotator’s data every time any sort of randomization happens.

So this is basically my implementation:

def set_up_randomizer(scatter_freq, sky_freq, floating_camera = False, callBack = None):
    with rep.new_layer():
        register_randomization_function(floating_camera)
        scatter_interval = 1/scatter_freq
        sky_interval = 1/sky_freq   
        carb.log_info("Scattering Randomization Interval = " + str(scatter_interval) + "   Sky Randomization Interval = " + str(sky_interval))
        with rep.trigger.on_time(interval = scatter_interval):
            randomize_scatter(floating_camera)
            if callBack:
                callBack()
        with rep.trigger.on_time(interval = sky_interval):
            randomize_sky()
            if callBack:
                callBack()

So basically I pass my function as a callback. Now this does not work. So my question is, how can I call a none-replicator function from set_up_randomizer.

or, how can I create an event and trigger it in each rep.trigger.on_time and listen to that event in my camera signal class?

Thank you