Skip to content
This repository has been archived by the owner on Aug 13, 2023. It is now read-only.

Message IDs #3

Open
DarthGandalf opened this issue Jan 14, 2015 · 1 comment
Open

Message IDs #3

DarthGandalf opened this issue Jan 14, 2015 · 1 comment

Comments

@DarthGandalf
Copy link

The way with milliseconds (as now) is not correct, because several messages might come within the same millisecond.

Let's assign some ID to every message. They need to be increasing to make implementation of clients easier, so GUID doesn't work for that.

My proposal is to use a pair (timestamp, number). Every second (or millisecond) the counter is reset, and for every message the counter is increased. That way every message will have its own ID, and client can request messages from that ID, without hoping that no other messages happened in the same millisecond.
The counter may be one for the whole network, or one per channel/query, that's an implementation detail.

@jpnurmi
Copy link
Owner

jpnurmi commented Jan 16, 2015

There's a chance for an occasional double message, but I'm a bit sceptic to start over-engineering this. After all, I've been happily using the module for a year now. :)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants