HCE Project Python language Distributed Tasks Manager Application, Distributed Crawler Application and client API bindings.  2.0.0-chaika
Hierarchical Cluster Engine Python language binding
Response.py
Go to the documentation of this file.
1 '''
2 Created on Feb 5, 2014
3 
4 @author: igor
5 '''
6 
7 
8 
11 class ResponseFormatErr(Exception):
12 
13  def __init__(self, message):
14  Exception.__init__(self, message)
15 
16 
17 
20 class Response(object):
21  '''
22  Wrapper over hce response protocol - so it can raise AttributeError:
23  when construct from wrong protocol format
24  '''
25 
26 
27 
33  def __init__(self, data, connect_identity=None):
34  if len(data) < 2:
35  raise ResponseFormatErr(data)
36  self.connect_identity = connect_identity
37  self.uid = data[0]
38  self.body = data[1]
39 
40 
41 
44  def get_uid(self):
45  return self.uid
46 
47 
48 
51  def get_body(self):
52  return self.body
def get_body(self)
get_body
Definition: Response.py:51
It&#39;s a wrapper similar to zmsg.hpp in sense of encapsulation of hce response message structure...
Definition: Response.py:20
def __init__(self, data, connect_identity=None)
constructor parse data according to the protocol
Definition: Response.py:33
def get_uid(self)
get_uid
Definition: Response.py:44
Exception which inform about errors which appeared during the hce protocol parsing procedure...
Definition: Response.py:11