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
Main Page
Related Pages
+
Namespaces
Namespace List
+
Namespace Members
+
All
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
+
Functions
_
a
b
c
d
e
f
g
i
j
l
m
o
p
r
s
t
u
v
w
+
Variables
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
+
Classes
Class List
Class Index
Class Hierarchy
+
Class Members
+
All
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
z
+
Functions
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
r
s
t
u
v
w
x
+
Variables
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
z
+
Files
File List
▼
HCE Project Python language Distributed Tasks Manager Application, Distributed Crawler Application and client API bindings.
►
HCE project, Python bindings, Distributed Tasks Manager application, Distributed Crawler service.
Todo List
►
Namespaces
►
Classes
▼
Files
►
File List
•
All
Classes
Namespaces
Files
Functions
Variables
Pages
IDGenerator.py
Go to the documentation of this file.
1
'''
2
Created on Feb 4, 2014
3
4
@author: igor, bgv
5
'''
6
7
8
import
socket
9
import
time
10
import
uuid
11
from
transport.Singelon
import
Singleton
12
13
15
class
IDGenerator
(object):
16
'''
17
The class is used to generate unique ID for connections
18
'''
19
__metaclass__ = Singleton
20
21
def
__init__
(self):
22
'''
23
Constructor
24
'''
25
#@var _connection_uid
26
#a member variable, holds generator internal state
27
self.
_connection_uid
= 0
28
29
30
"""
31
Generate unique connection id
32
"""
33
36
def
get_connection_uid
(self, idType=0):
37
ret =
None
38
39
self.
_connection_uid
= self.
_connection_uid
+ 1
40
if
idType == 0:
41
ret = socket.gethostname() +
"-"
+ str(time.time()) +
"-"
+ uuid.uuid1().hex +
"-"
+ str(self.
_connection_uid
)
42
else
:
43
ret = str(self.
_connection_uid
)
44
45
return
ret
46
transport.Singelon
Definition:
Singelon.py:1
transport.IDGenerator.IDGenerator.get_connection_uid
def get_connection_uid(self, idType=0)
generate unique connection id
Definition:
IDGenerator.py:36
transport.IDGenerator.IDGenerator._connection_uid
_connection_uid
Definition:
IDGenerator.py:27
transport.IDGenerator.IDGenerator.__init__
def __init__(self)
Definition:
IDGenerator.py:21
transport.IDGenerator.IDGenerator
IDGenerator is used to generate unique id for connections.
Definition:
IDGenerator.py:15
sources
hce
transport
IDGenerator.py
Generated on Fri Nov 24 2017 18:54:03 for HCE Project Python language Distributed Tasks Manager Application, Distributed Crawler Application and client API bindings. by
1.8.13