This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import zmq | |
# Server | |
class Server(): | |
def __init__(self, context): | |
self.context = context | |
self.router = self.context.socket(zmq.ROUTER) | |
self.router.bind("tcp://127.0.0.1:9876") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def get_sync_info(source_id): | |
""" | |
Gets the sync information. | |
""" | |
socket.send_multipart([req_type, source_id]) | |
# Should return the response to the above request. | |
# Some callback should return the response probably. | |
return response |
NewerOlder