Skip to content

Commit 41f0c5f

Browse files
authored
Merge pull request #6 from fabianofa/master
Adds retry milliseconds as parameter
2 parents 7d11d66 + 2061163 commit 41f0c5f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/SSE.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
class SSE
66
{
7-
public function start(Update $update, $eventType = null)
7+
public function start(Update $update, $eventType = null, int $milliRetry = 2000)
88
{
99
while (true) {
1010
$changedData = $update->getUpdatedData();
@@ -13,7 +13,7 @@ public function start(Update $update, $eventType = null)
1313
'id' => uniqid('', true),
1414
'type' => $eventType,
1515
'data' => (string)$changedData,
16-
'retry' => 2000,//reconnect after 2s
16+
'retry' => $milliRetry,
1717
];
1818
} else {
1919
$event = [

0 commit comments

Comments
 (0)