spring-projects / spring-rewrite-commons

Apache License 2.0
9 stars 11 forks source link

Publish event when a recipe made changes #62

Open fabapp2 opened 9 months ago

fabapp2 commented 9 months ago

What needs to be done

Publish an event after each recipe that made changes. OpenRewrite collects a list of recipes that made changes in the ExecutionContext.

Why it needs to be done

Applying a recipe can take quite some time and listening to those events would allow to provide progress information to the user.

Possible Implementations

  1. Overwrite the putMessage in RewriteExecutionContext and intercept messages unter the recipesThatMadeChanges (I think) key and publish them as Spring application event using ApplicationEventPublisher
  2. Achieve the same using the WatchableExecutionContext.