using longpoll with _active_tasks (maybe J. Chris Anderson knows?)

20 views
Skip to first unread message

Seung Chan Lim

unread,
Oct 24, 2014, 4:35:00 PM10/24/14
to mobile-c...@googlegroups.com
I'm trying to use longpoll with a call to http://lite.couchbase./_active_tasks instead of continuous. Why? Because with continuous it keeps appending to the http response buffer, which can grow indefinitely.

The question I have is how can I make a call to _active_tasks with longpoll such that each subsequent call "advances" the responses? The behavior I see now is that it just repeats itself. It doesn't "move on" to the next bits of information.

From what I understand to do this with _changes I send it the since parameter. Is there an equivalent in this context?

slim

Jens Alfke

unread,
Oct 24, 2014, 5:18:45 PM10/24/14
to mobile-c...@googlegroups.com
On Oct 24, 2014, at 1:35 PM, Seung Chan Lim <djs...@gmail.com> wrote:

I'm trying to use longpoll with a call to http://lite.couchbase./_active_tasks instead of continuous. Why? Because with continuous it keeps appending to the http response buffer, which can grow indefinitely.

There isn't a longpoll option for that. You just GET /_active_tasks without the "continuous" flag.

The question I have is how can I make a call to _active_tasks with longpoll such that each subsequent call "advances" the responses? The behavior I see now is that it just repeats itself. It doesn't "move on" to the next bits of information.

It returns the entire list of active tasks immediately. You'd have to set up a timer to poll it periodically, i.e. every few seconds.

It's probably more efficient to keep using the 'continuous' mode, but close and re-open the connection once in a while to avoid building up too big a response buffer.

—Jens

Reply all
Reply to author
Forward
0 new messages