0

The Swiftotter Magento developer Study guide states concerning Observers:

Event data should be able to be stored and then run in a queue at a later time.

Is this correct? Do I really have to assume that my events observers are ran in a asynchronous way at a later time?

1

Depends how you look at it. Magento is (MySQL) transactional which means things are getting queued whilst tables are locked. They are then processed in a first come first serves basis when locks are released. Observers would also work on this basis. I don't believe community edition has anything more complex then that. I've read about enterprise edition having what's essentially a worker queue. But I think in this context that's what they mean.

0

I also found this now in the dev docs:

https://devdocs.magento.com/guides/v2.1/coding-standards/technical-guidelines.html#14-events

14.1. All values (including objects) passed to an event MUST NOT be modified in the event observer. Instead, plugins SHOULD BE used for modifying the input or output of a function.

So I think if we follow this rule, events could really be executed asynchronously.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.