Skip to content

Commit

Permalink
Send the first message asap
Browse files Browse the repository at this point in the history
  • Loading branch information
louisremi committed Jun 16, 2011
1 parent 598f23f commit 6525842
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion demos/friends timeline/sse.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,13 @@

// Send one message every 2 to 7 seconds
foreach ( $messages as $message ) {
sleep( rand(2, 7) );
echo $message;
echo "\n\n";

ob_flush();
flush();

sleep( rand(2, 7) );
}

?>

0 comments on commit 6525842

Please sign in to comment.