Closed eXCom closed 3 years ago
Hi @eXCom ,
many thanks for your question. The Folder::idle()
command is exactly designed to do just this - idle and call the callback as soon as a new message arrives. Its not supposed to ever "finish"..
If you want to fetch new messages, you'll have to use the Folder::query()
method - or implement a websocket and combine it with the idle method. Take a look at the implemented event / subscriber support https://www.php-imap.com/frameworks/laravel/events - they might help you as well :)
Best regards,
P.s.: if you have any questions regarding the core webklex/php-imap
, please head over to the core repository https://github.com/Webklex/php-imap and create an new issue there.
Thank you @Webklex very much for such a quick responce, i'll look into it!
Im trying to check for new messages using ajax request. When im just trying to listen to new messages on backend only with php, everything works fine.
But if im trying to send ajax request from frontend to backend, my request is pending.
I also tried
Its the same, pending... Looks like ->idle() is just infinitely repeating itself, i would like to check for messages once and get a responce
Is there any way to achieve what im trying to do ?