wandenberg / nginx-push-stream-module

A pure stream http push technology for your Nginx setup. Comet made easy and really scalable.
Other
2.22k stars 295 forks source link

Send event time to onmessage callback #180

Closed simion closed 9 years ago

simion commented 9 years ago

In some cases, pleople might need the time of the event in their application. In most cases, (new Date()).getTime() will do the job, but when you load a stored messages, this is not usable anymore. This change sends event time on onmessage callback as 6th parameter (after isLastMessageFromBatch).

The event time is sent in GMT timezone.

The scenario for which i had to do this change: I use pushstream for a realtime dashboard, and i aggregate events per second, and per minute. because I load data since 4 hours ago, i needed the time of the event so i can aggregate history properly.

wandenberg commented 9 years ago

Applied with minor changes on fbcb6222a2a7a3882f5ec5efe55c2bf6693c8c7e