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
transport.UIDGenerator.UIDGenerator Class Reference

UIDGenerator is used to generate unique message id. More...

Inheritance diagram for transport.UIDGenerator.UIDGenerator:
Collaboration diagram for transport.UIDGenerator.UIDGenerator:

Public Member Functions

def __init__ (self)
 constructor More...
 
def get_uid (self, idType=0)
 get_uid More...
 

Private Attributes

 _start
 

Detailed Description

UIDGenerator is used to generate unique message id.

Definition at line 14 of file UIDGenerator.py.

Constructor & Destructor Documentation

◆ __init__()

def transport.UIDGenerator.UIDGenerator.__init__ (   self)

constructor

Constructor

Definition at line 19 of file UIDGenerator.py.

19  def __init__(self):
20  '''
21  Constructor
22  '''
23  #@var _start
24  #a member variable, holds generator internal state
25  self._start = 0
26 
27 
def __init__(self)
constructor
Definition: UIDGenerator.py:19

Member Function Documentation

◆ get_uid()

def transport.UIDGenerator.UIDGenerator.get_uid (   self,
  idType = 0 
)

get_uid

Returns
uid as string

Definition at line 31 of file UIDGenerator.py.

31  def get_uid(self, idType=0):
32  self._start = self._start + 1
33  if idType == 0:
34  idGenerator = IDGenerator()
35  #return str(binascii.crc32(idGenerator.get_connection_uid() + str(self._start)))
36  return "%d" % binascii.crc32(idGenerator.get_connection_uid() + str(self._start), int(time.time()))
37  else:
38  return str(self._start)
39 
40 
def get_uid(self, idType=0)
get_uid
Definition: UIDGenerator.py:31

Member Data Documentation

◆ _start

transport.UIDGenerator.UIDGenerator._start
private

Definition at line 25 of file UIDGenerator.py.


The documentation for this class was generated from the following file: