-
each client holds open one primary and potentially multiple secondary connections
-
subscribe(qid, callback):-
stores an item mapping
qidtocallback -
opens a
secondary_channelwithqid -
stores an item mapping
qidtosecondary_channel -
on_primary_response:dedupe_callback(qid, item)for item in items- update
seen - for channel in secondary_channels:
- add
qidto primary if qid not in primary - flag secondary as
ready_to_close
- add
-
on_secondary_responsededupe_callback(qid, item)for item in itemsclose()ifready_to_close
-
-
unsubscribe(qid):- remove item mapping
qidtocallback - stores an item mapping
qidtoto_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