Skip to content

Instantly share code, notes, and snippets.

@indradhanush
Created June 16, 2014 19:08
Show Gist options
  • Save indradhanush/949cb5d2de97f3258d6a to your computer and use it in GitHub Desktop.
Save indradhanush/949cb5d2de97f3258d6a to your computer and use it in GitHub Desktop.
get_sync_info() in zmq
class ZMQSyncTarget(ZMQClientBase, SyncTarget):
def get_sync_info(self, source_replica_uid):
"""
Returns the sync state.
Note: Doesnt return anything now. BROKEN.
"""
str_msg = serialize_msg("SourceRequest",
source_replica_uid=source_replica_uid)
str_sync_type = serialize_msg("SyncType", sync_type="sync-from")
str_zmq_verb = serialize_msg("ZMQVerb", verb=proto.ZMQVerb.GET)
to_send = [str_msg, str_sync_type, str_msg]
self.speaker.send(to_send)
# TODO: Find a way to return the response of the above request.
# return async_response
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment