Nick
Nick

Reputation: 870

Async & Sync plugins on the same event

I have a sync plugin that triggers on Entity A, Update Post Operation event. I have another Async plugin that triggers on the same Entity A and on the Update Post Operation as well. These 2 plugins serve different purposes and they must be registered this way.

I have the execution order set as follows: Sync plugin 1 Async plugin 2

My question is if the Sync plugin triggers first and throw exception, does the Async plugin still triggers and what about if I switch them so the Async will have execution order 1 and the Sync execution order 2.

My goal is to rollback any update if any of these 2 plugins throw an exception.

Upvotes: 1

Views: 2884

Answers (1)

Henk van Boeijen
Henk van Boeijen

Reputation: 7948

Only when the synchronous plugin pipeline finishes without errors, asynchronous plugins are triggered.

So, the answer to your question is: no.

Upvotes: 3

Related Questions