Browse Source

add documentation for event_api.polling_stream

pull/2/merge
Brett Langdon 13 years ago
parent
commit
4bac3b906c
2 changed files with 12 additions and 0 deletions
  1. +2
    -0
      README.md
  2. +10
    -0
      lib/api/event.js

+ 2
- 0
README.md View File

@ -25,6 +25,8 @@ npm install
* `dogapi.stream(start, end, [[filter], callback])` * `dogapi.stream(start, end, [[filter], callback])`
* function used to retrieve all events that have occured between * 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)` * `dogapi.get_event(event_id, callback)`
* method used to retrieve a single event's data * method used to retrieve a single event's data
* `dogapi.add_event(event, callback)` * `dogapi.add_event(event, callback)`


+ 10
- 0
lib/api/event.js View File

@ -58,6 +58,16 @@ event_api.prototype.stream = function(start, end, filter, callback){
}; };
event_api.prototype.polling_stream = function(interval, 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)){ if(arguments.length < 3 && v8type.is(arguments[1], v8type.FUNCTION)){
callback = arguments[1]; callback = arguments[1];
filter = {}; filter = {};


Loading…
Cancel
Save