Skip to content

Issue-39: Allow an implementer-provided callback to be executed after each batch #41

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

dustinpaluch
Copy link

Summary

Fixes #39

This pull request implements the feature request for allowing an implementer-provided callback to be executed after each bulk task batch. This feature aims to make the after_batch function pluggable, providing flexibility for different implementations and use cases.

Description

The bulk task functionality currently includes an after_batch function which is executed after each batch is processed. However, this function is not pluggable, limiting the ability to customize post-batch processing. This pull request addresses this limitation by allowing an implementer to plug in their own callback to be executed after each batch.

Reference: wp-bulk-task implementation

Use Case

This feature was requested to fulfill a specific need identified by Alley developers, as documented here.

Acceptance Criteria

  • Implement a mechanism to allow a custom callback to be provided during the bulk task setup.
  • The custom callback will be executed within the after_batch function.
  • Define and document the parameters available to the custom callback, such as current cursor position and the maximum number of records.

Additional Notes

This feature request is similar to a previous request (see #38 for context).

For more details, refer to the original issue here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request php Requires understanding PHP
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Allow an implementer-provided callback to be executed after each batch
1 participant