oliverbusk
5 months ago

Will event listeners run in sync?

Posted 5 months ago by oliverbusk

Hi all

I have a website, where when my users upload document, an event will be fired:

protected $listen = [
    DocumetCreated::class => [
       CreateDocumentFolders::class,
       ConvertPDFToImages::class
    ],
];

As you can see, whenever a document is uploaded and the event is fired, I have two listeners defined.

Both my listeners uses the InteractsWithQueue; trait, so I know they will not run in sync.

However my question is, will

CreateDocumentFolders run first and then when that is finished (return $true), then ConvertPDFToImages will run?

The CreateDocumentFolders will need to run before ConvertPDFToImages.

Please sign in or create an account to participate in this conversation.