Skip to content

Commit 3276422

Browse files
authored
Clarify idle
1 parent bf57cd6 commit 3276422

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

readme.md

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -569,7 +569,7 @@ $inbox = $mailbox->inbox();
569569
// be executed whenever a new message is received.
570570
$inbox->idle(function (Message $message) {
571571
// Do something with the newly received message.
572-
}, timeout: 300); // Optional timeout in seconds.
572+
});
573573
```
574574

575575
By default, messages received in idle will not be fetched with all of their content (flags, headers, and body with attachments).
@@ -588,3 +588,13 @@ $inbox->idle(function (Message $message) {
588588
->withFlags();
589589
});
590590
```
591+
592+
If your IMAP server requires a specific timeout, you may specify one in the third parameter (or using the parameter name):
593+
594+
```php
595+
use DirectoryTree\ImapEngine\MessageQuery;
596+
597+
$inbox->idle(function (Message $message) {
598+
// ...
599+
}, timeout: 1200); // 20 minutes
600+
```

0 commit comments

Comments
 (0)