enable the user to pass in a function to get records that is run every request iteration