def METHOD_NAME(
    app_name: str, model_name: str, make_outboxes: Callable[[BaseModel], None], task: Task
) -> None:
    try:
        model: Any = apps.get_model(app_label=app_name, model_name=model_name)
        processing_state = _chunk_processing_batch(model, batch_size=get_batch_size())
        if not processing_state:
            return
        for inst in model.objects.filter(id__gt=processing_state.low, id__lte=processing_state.up):
            with outbox_context(transaction.atomic(router.db_for_write(model)), flush=False):
                make_outboxes(inst)
        if not processing_state.has_more:
            set_processing_state(model._meta.db_table, 0, model.replication_version + 1)
        else:
            set_processing_state(
                model._meta.db_table, processing_state.up, processing_state.version
            )
            task.apply_async(
                kwargs=dict(
                    app_name=app_name,
                    model_name=model_name,
                ),
                countdown=15,
            )
    except Exception:
        sentry_sdk.capture_exception()
        raise