publisher/subscriber implementations
--HG-- branch : sandbox
This commit is contained in:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user