yield from $this->
getPendingMessages();
} private function fetchMessage(): bool
{ if (!
$this->currentResponse->
resolve($this->configuration
['poll_timeout'
])) { return false;
} foreach ($this->currentResponse->
getMessages() as $message) { $headers =
[];
$attributes =
$message->
getMessageAttributes();
if (isset($attributes[self::MESSAGE_ATTRIBUTE_NAME
]) && 'String' ===
$attributes[self::MESSAGE_ATTRIBUTE_NAME
]->
getDataType()) { $headers =
json_decode($attributes[self::MESSAGE_ATTRIBUTE_NAME
]->
getStringValue(), true
);
unset($attributes[self::MESSAGE_ATTRIBUTE_NAME
]);
} foreach ($attributes as $name =>
$attribute) { if ('String' !==
$attribute->
getDataType()) { continue;
} $headers[$name] =
$attribute->
getStringValue();
}