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

Extend messagesPublishedAfter with Callback #220

Closed fpieper closed 8 years ago

fpieper commented 8 years ago

You can initialize messagesPublishedAfter with a callback function or with a number like till now.

Just return the amounts of seconds in the function. So you are able to calculate the value in a dynamic way (e.g. offset since last message).

For example:

new PushStream({
      messagesPublishedAfter: function() {return 60}
}
wandenberg commented 8 years ago

Hi @fpieper

do you have any other use case than that? I'm asking because you can only set the messagesPublishedAfter as a Date object being the date of the last received message and it will be used as start point to get old messages. As far as I can see is unnecessary to add this support to a callback. If you have another use case, please let me know. And to speed up the acceptance of your pull request try to add a test to it.