增加rpc客户端的回调函数中的主题参数

This commit is contained in:
chenxy123 2016-10-09 23:22:51 +08:00
parent f538e6aa12
commit 0cac529264
3 changed files with 5 additions and 5 deletions

View File

@ -1,5 +1,5 @@
<?xml version="1.0"?> <?xml version="1.0"?>
<SubscriptionDataContainer xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="urn:Microsoft.VisualStudio.WindowsAzure.CommonAzureTools.Authentication.CacheManagement"> <SubscriptionDataContainer xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="urn:Microsoft.VisualStudio.WindowsAzure.CommonAzureTools.Authentication.CacheManagement">
<Items /> <Items />
<TokenCache>AQAAANCMnd8BFdERjHoAwE/Cl+sBAAAAhuIZgFnYcU6wvp5DI4FozAAAAAACAAAAAAAQZgAAAAEAACAAAADbHX9MGY1db5F4b+OyG6c/B78GOMBlEj6iQbaFcLZJCAAAAAAOgAAAAAIAACAAAADn7kKZgsW4pBHXuVEmex+oXTGG5hNRZGiXkpNGYXsFPBAAAACHqHiPVtiM03bftyY0V78iQAAAACpQVRyEMAhwGyl6Ekto5M6tZRU4Nu9lGQ6I+0d85GOVYFPsld6n8j1heCXRQ5facD4R4R9fqjq858G/Iyjl0vQ=</TokenCache> <TokenCache>AQAAANCMnd8BFdERjHoAwE/Cl+sBAAAAhuIZgFnYcU6wvp5DI4FozAAAAAACAAAAAAAQZgAAAAEAACAAAAAP+ZejtWt08T4CHAObG1FMrnjuDrDgxp3Kgz3p0GFTiAAAAAAOgAAAAAIAACAAAADnqXDqufrv721M+KR/tLuCYzN6ynSphcMeiL+hw9/zfBAAAAA0xC0ncTgoWKgyHhV01sFjQAAAAHPVrjN2gp4P8U/lDH6S7DXnH0r85ILsW5BB0pf0XLyQTdX5KoNz8//d+jBnTKg15QzO9mS8Bc1TVIuzVWasdjI=</TokenCache>
</SubscriptionDataContainer> </SubscriptionDataContainer>

View File

@ -15,9 +15,9 @@ class TestClient(RpcClient):
super(TestClient, self).__init__(reqAddress, subAddress) super(TestClient, self).__init__(reqAddress, subAddress)
#---------------------------------------------------------------------- #----------------------------------------------------------------------
def callback(self, data): def callback(self, topic, data):
"""回调函数实现""" """回调函数实现"""
print 'client received:', data print 'client received topic:', topic, ', data:', data
if __name__ == '__main__': if __name__ == '__main__':

View File

@ -241,10 +241,10 @@ class RpcClient(RpcObject):
data = self.unpack(datab) data = self.unpack(datab)
# 调用回调函数处理 # 调用回调函数处理
self.callback(data) self.callback(topic, data)
#---------------------------------------------------------------------- #----------------------------------------------------------------------
def callback(self, data): def callback(self, topic, data):
"""回调函数,必须由用户实现""" """回调函数,必须由用户实现"""
raise NotImplementedError raise NotImplementedError