Improved asynchronous message procession

This commit is contained in:
Michael 2023-10-25 20:16:36 +00:00
parent c88b1c0197
commit a1947d2bb1
8 changed files with 46 additions and 38 deletions

View file

@ -80,6 +80,7 @@ class Receiver
const COMPLETION_RELAY = 2;
const COMPLETION_MANUAL = 3;
const COMPLETION_AUTO = 4;
const COMPLETION_ASYNC = 5;
/**
* Checks incoming message from the inbox
@ -681,7 +682,7 @@ class Receiver
return true;
}
if (!empty($object_data['entry-id']) && $decouple && ($push || ($completion == self::COMPLETION_RELAY))) {
if (!empty($object_data['entry-id']) && $decouple && ($push || in_array($completion, [self::COMPLETION_RELAY, self::COMPLETION_ASYNC]))) {
if (Queue::isProcessable($object_data['entry-id'])) {
// We delay by 5 seconds to allow to accumulate all receivers
$delayed = date(DateTimeFormat::MYSQL, time() + 5);