omersaeed/mesh — pull request #1 by aaronj1335 (2012-06-21 22:22:19+00:00)
Title: Poll

i've added a unit tests to show the desired functionality of the `.poll()` method. you should be able to merge this into the omersaeed/mesh:poll branch, make them pass, and then we can just merge those into siq/mesh:master. a few notes:

- the arguments of `poll()` should just be a single `params` object
- in most cases we'll just want to use the default interval that `Model.poll` will set
- in the future we'll probably want to make this back off exponentially, so it won't even be a constant
- but we'll want a more general solution (a util function in siq/bedrockjs or something) for now we can just set it to 1 or 2 seconds or something

- i don't think the logic is quite right:
- `_.delay` takes a function as the first argument
- but it appears that it's getting the return value of `self.refresh()`, which is a deferred
- additionally, we'll need to make sure the callback executes in the context of `self`
- so i'm guessing it should be something more like:

_.delay(_.bind(self.refresh, self), interval);