publisher/subscriber implementations

--HG--
branch : sandbox
This commit is contained in:
baloan
2011-03-14 11:31:19 +01:00
parent addf55c69b
commit 38e71583c4
5 changed files with 66 additions and 12 deletions

View File

@@ -71,7 +71,7 @@ def main(argv=None):
thread.start()
LOG.info('waiting for connection on %s', address)
# acceptor in main thread
try:
while True:
LOG.info("Waiting for accept...")
@@ -157,7 +157,6 @@ class Pricer():
def __init__(self, name):
self.name = name
self.prc = random.random() * 100.0
self.daemon = True
def run(self):
self.prc += random.choice((-1, +1)) * self.VOLA
@@ -165,6 +164,6 @@ class Pricer():
if __name__ == '__main__':
logging.basicConfig(level=logging.DEBUG,
format='%(asctime)s.%(msecs)03i %(levelname).4s %(threadName)10s %(message)s',
format='%(asctime)s.%(msecs)03i %(levelname).4s %(threadName)10s %(funcName)10s %(message)s',
datefmt='%H:%M:%S')
main()