Asynchronous plugin execution order

If I change the same record three times and I have an asynchronous plugin listening to the message “Update”, will updates be ordered?

I expect updates to be streamlined even if they run asynchronously (correctly queued for later execution). If so, I hope this is true for creating and deleting messages.

Thanks in advance.

+4
source share
3 answers

With asynchronous plugins, the execution order is not guaranteed, if you want the plugins to be executed in a queued manner, you need to use the DependencyToken attribute.

You can find the article here:

Dependency and execution order in asynchronous operations

+4
source

In addition to @GuidosPreite, I can say that from the tests that I ran some time ago, the plugins will run in the order you expect.

However, as he says, do not bet on your home. If you're out of luck, the previous thread may be running with a longer delay than before. And subject to Murphy's law, he will .

In addition, the behavior may be different on different convolutions, servers, days of the week, etc. So, in short: yes, but no.

+2
source

Can someone explain why the link in @Guido Preite's answer does not work with the asynchronous plugin approach? And is there a piece of code where this DependencyToken value is set for an asynchronous operation? Thanks!

-2
source

All Articles