IDEO-coLAB / nomad

A package and protocol for a global, dispersed sensor network
47 stars 6 forks source link

Subscribing nodes can mark messages as seen #18

Closed ReidWilliams closed 7 years ago

ReidWilliams commented 8 years ago

Subscribing nodes can mark messages as seen or set an index, low water mark, or other structure that prevents older messages from being delivered more than once.

The current subscribe API fires a single callback whenever any stream has a new message, delivering an array of the latest messages from all streams. This may include messages that the node has already seen if a given stream doesn't have any new messages.

Is this the right API? Should we switch to (or add) one callback per stream?

ReidWilliams commented 7 years ago

Closing this issue. API now fires callback with argument containing message for each subscription rather than a callback with argument containing messages for all subscriptions. Added "caching" that tracks which messages for each subscription have already been delivered.