-
each client holds open one primary and potentially multiple secondary connections
-
subscribe(qid, callback)
:-
stores an item mapping
qid
tocallback
-
opens a
secondary_channel
withqid
-
stores an item mapping
qid
tosecondary_channel
-
on_primary_response
:dedupe_callback(qid, item)
for item in items- update
seen
- for channel in secondary_channels:
- add
qid
to primary if qid not in primary - flag secondary as
ready_to_close
- add
-
on_secondary_response
dedupe_callback(qid, item)
for item in itemsclose()
ifready_to_close
-
-
unsubscribe(qid)
:- remove item mapping
qid
tocallback
- stores an item mapping
qid
toto_remove
- for channel in secondary_channels:
- flag as
ready_to_close if channel.qid == qid
- flag as
- remove item mapping
-
constructor
:- starts a cleanup loop that removes old items
Created
December 5, 2011 14:00
-
-
Save thruflo/1433666 to your computer and use it in GitHub Desktop.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment