diff --git a/README.md b/README.md index c3e6b7a..d1b5c03 100644 --- a/README.md +++ b/README.md @@ -25,6 +25,8 @@ npm install * `dogapi.stream(start, end, [[filter], callback])` * function used to retrieve all events that have occured between +* `dogapi.polling_stream(interval, [[filter], callback])` + * function used to continuously call `stream` for new events * `dogapi.get_event(event_id, callback)` * method used to retrieve a single event's data * `dogapi.add_event(event, callback)` diff --git a/lib/api/event.js b/lib/api/event.js index 9839bd2..17f280e 100644 --- a/lib/api/event.js +++ b/lib/api/event.js @@ -58,6 +58,16 @@ event_api.prototype.stream = function(start, end, filter, callback){ }; event_api.prototype.polling_stream = function(interval, filter, callback){ + /* + * event_api.polling_stream(interval, [[filter], callback] ) + * + * function used to continuously call `stream` for new events + * + * `interval` seconds between each call + * `filter` is an object to limit the results by + * `callback` is an optional function called with the results of the api call + * callback(error, result, status_code) + */ if(arguments.length < 3 && v8type.is(arguments[1], v8type.FUNCTION)){ callback = arguments[1]; filter = {};