예제 #1
0
파일: poc-db.py 프로젝트: jeffmurphy/cif-db
     cf = Foundation({'apikey' : apikey,
                      'myip'   : myip,
                      'cifrouter' : cifrouter,
                      'controlport' : controlport,
                      'myid' : myid,
                      'routerid' : "cif-router",
                      'thread_tracker' : thread_tracker
                      })
 
     primary_index = PrimaryIndex(connectionPool, debug)
     secondary_index = SecondaryIndex(connectionPool, debug)
     
     print "Configuring foundation"
     
     cf.setdebug(debug)
     cf.setdefaultcallback(controlMessageHandler, {'connectionPool': connectionPool})
     
     print "Register with " + cifrouter + " (req->rep)"
     req = cf.ctrlsocket()
 
     # apikey, req, myip, myid, cifrouter
     (routerport, routerpubport) = cf.register()
 
     subscriber = cf.subscribersocket()
     
     time.sleep(1) # wait for router to connect, sort of lame but see this a lot in zmq code
     
     print "Initializing Exploder"
     exploder = Exploder.Exploder(connectionPool, thread_tracker, False)
     
     print "Initializing Purger"
예제 #2
0
    apikey = apikeys.get_by_alias(myid)
    
    print "Initializing foundation"
    
    cf = Foundation({'apikey' : apikey,
                     'myip'   : myip,
                     'cifrouter' : cifrouter,
                     'controlport' : controlport,
                     'myid' : myid,
                     'routerid' : "cif-router"
                     })

    print "Configuring foundation"
    
    cf.setdebug(debug)
    cf.setdefaultcallback(controlMessageHandler)
    
    print "Register with " + cifrouter + " (req->rep)"
    req = cf.ctrlsocket()

    # apikey, req, myip, myid, cifrouter
    (routerport, routerpubport) = cf.register()

    subscriber = cf.subscribersocket()
    
    time.sleep(1) # wait for router to connect, sort of lame but see this a lot in zmq code
    
        
    print "Initializing Exploder"
    exploder = Exploder.Exploder(hbhost, False)
    exploder.do_some_work()