Closed sompylasar closed 9 years ago
Hi @sompylasar ,
Let me close this pull request w/o merging.
Results of my overnight sleep with this idea. We should have two flags:
n
for the minimum number of entries to return, as in tail -n 10
. The last n
entries are returned.cap
for the maximum number of entries to return.The behavior is:
cap
is set, HTTP connection terminates after cap
entries have been sent. Those can be cap
entries since the beginning of the stream, or since recent
, or since other "data beginning" parameter.(Note that the connection is potentially indefinite, in case the stream does yet not have cap
entries to output.)
n
is set, cap
is assumed to be equal to n
. Thus, providing n
results not only in at least N, but also in at most N. Use ?n=10&cap=0
to get indefinite stream with at least n
entries returned.n
overrides recent
or other time-range-defining parameters. Thus, ?n=10&recent=10000
means "entries from the past 10 seconds, but do go further into the past if this is required to output at least 10 entries".Thanks, Dima
PubSubHTTPEndpoint: Introduced
n_min
, renamedn
ton_max
.n_min
is required to be able to request at leastn_min
entries even if there were no entries within therecent
time frame.