• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Python native.CallbackScheduler类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Python中ufora.native.CallbackScheduler的典型用法代码示例。如果您正苦于以下问题:Python CallbackScheduler类的具体用法?Python CallbackScheduler怎么用?Python CallbackScheduler使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



在下文中一共展示了CallbackScheduler类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。

示例1: __init__

    def __init__(self):
        callbackSchedulerFactory = CallbackScheduler.createSimpleCallbackSchedulerFactory()
        self.callbackScheduler = callbackSchedulerFactory.createScheduler("Simulator", 1)

        self.uforaPath = os.path.abspath(os.path.join(os.path.dirname(__file__), '../'))

        self.sharedStatePath = os.path.join(self.uforaPath, 'distributed/SharedState')
        self.sharedStateMainline = os.path.join(self.sharedStatePath, 'sharedStateMainline.py')

        self.gatewayServiceMainline = os.path.join(self.uforaPath, 'scripts/init/ufora-gateway.py')

        self.webPath = os.path.join(self.uforaPath, 'web/relay')
        self.relayScript = os.path.join(self.webPath, 'server.coffee')

        self.relayPort = Setup.config().relayPort
        self.relayHttpsPort = Setup.config().relayHttpsPort
        self.sharedStatePort = Setup.config().sharedStatePort
        self.restApiPort = Setup.config().restApiPort
        self.subscribableWebObjectsPort = Setup.config().subscribableWebObjectsPort

        #create an OutOfProcessDownloader so we can execute commands like 'forever'
        #from there, instead of forking from the main process (which can run out of memory)
        self.processPool = OutOfProcessDownloader.OutOfProcessDownloaderPool(1)


        self.desirePublisher = None
        self._connectionManager = None
开发者ID:ufora,项目名称:ufora,代码行数:27,代码来源:ClusterSimulation.py


示例2: __init__

    def __init__(self, numRandVals, numRelaxations, maxForRelax, maxForRand, testAxiomsPath, seed):
        object.__init__(self)
        self.callbackScheduler = CallbackScheduler.singletonForTesting()
        self.callbackSchedulerFactory = self.callbackScheduler.getFactory()
        
        self.numRandVals = numRandVals
        self.numRelaxations = numRelaxations
        self.maxForRelax = maxForRelax
        self.maxForRand = maxForRand
        self.seed = seed

        self.runtime = Runtime.getMainRuntime()
        self.axioms = self.runtime.getAxioms()
        self.typed_fora_compiler = self.runtime.getTypedForaCompiler()

        if testAxiomsPath is not None:
            pathToUse = testAxiomsPath
        else:
            pathToUse = UNIT_TEST_AXIOMS_PATH

        self.axiom_signatures_to_test = self.loadAxiomSignaturesFromFile(pathToUse)

        self.axiom_groups = []
        for i in range(self.axioms.axiomCount):
            self.axiom_groups.append(self.axioms.getAxiomGroupByIndex(i))

        self.symbol_strings = self.loadSymbolStrings()

        numpy.random.seed(seed)
开发者ID:Sandy4321,项目名称:ufora,代码行数:29,代码来源:AxiomsConsistency_test.py


示例3: createService

def createService(args):
    callbackSchedulerFactory = CallbackScheduler.createSimpleCallbackSchedulerFactory()
    callbackScheduler = callbackSchedulerFactory.createScheduler('ufora-worker', 1)
    channelListener = MultiChannelListener(callbackScheduler,
                                           [args.base_port, args.base_port + 1])

    sharedStateViewFactory = ViewFactory.ViewFactory.TcpViewFactory(
        callbackSchedulerFactory.createScheduler('SharedState', 1),
        args.manager_address,
        int(args.manager_port)
        )

    channelFactory = TcpChannelFactory.TcpStringChannelFactory(callbackScheduler)

    diagnostics_dir = os.getenv("UFORA_WORKER_DIAGNOSTICS_DIR")
    eventHandler = diagnostics_dir and createEventHandler(
        diagnostics_dir,
        callbackSchedulerFactory.createScheduler("ufora-worker-event-handler", 1)
        )

    own_address = args.own_address or get_own_ip()
    print "Listening on", own_address, "ports:", args.base_port, "and", args.base_port+1

    return CumulusService.CumulusService(
        own_address,
        channelListener,
        channelFactory,
        eventHandler,
        callbackScheduler,
        diagnostics_dir,
        Setup.config(),
        viewFactory=sharedStateViewFactory
        )
开发者ID:nkhuyu,项目名称:ufora,代码行数:33,代码来源:ufora-worker.py


示例4: createViewFactory

def createViewFactory():
    callbackSchedulerFactory = CallbackScheduler.createSimpleCallbackSchedulerFactory()
    return ViewFactory.ViewFactory.TcpViewFactory(
        callbackSchedulerFactory.createScheduler('fora-interpreter', 1),
        'localhost',
        Setup.config().sharedStatePort
        )
开发者ID:Sandy4321,项目名称:ufora,代码行数:7,代码来源:fora_interpreter.py


示例5: createService

def createService(args):
    callbackSchedulerFactory = CallbackScheduler.createSimpleCallbackSchedulerFactory()
    callbackScheduler = callbackSchedulerFactory.createScheduler('ufora-gateway', 1)
    channelListener = ChannelListener.SocketListener(args.port)
    return BackendGatewayService.BackendGatewayService(callbackScheduler,
                                                       channelListener,
                                                       args.store_address)
开发者ID:WantonSoup,项目名称:ufora,代码行数:7,代码来源:ufora-gateway.py


示例6: createWorker_

def createWorker_(machineId,
                  viewFactory,
                  callbackSchedulerToUse,
                  threadCount,
                  memoryLimitMb,
                  cacheFunction,
                  pageSizeOverride,
                  disableEventHandler):
    if callbackSchedulerToUse is None:
        callbackSchedulerToUse = CallbackScheduler.singletonForTesting()

    vdm = ForaNative.VectorDataManager(
        callbackSchedulerToUse,
        pageSizeOverride if pageSizeOverride is not None else
        1 * 1024 * 1024 if memoryLimitMb < 1000 else
        5 * 1024 * 1024 if memoryLimitMb < 5000 else
        50 * 1024 * 1024
        )

    vdm.setMemoryLimit(
        int(memoryLimitMb * 1024 * 1024),
        min(int(memoryLimitMb * 1.25 * 1024 * 1024),
            int((memoryLimitMb + 1024 * 2) * 1024 * 1024))
        )

    vdm.setPersistentCacheIndex(
        CumulusNative.PersistentCacheIndex(
            viewFactory.createView(),
            callbackSchedulerToUse
            )
        )

    cache = cacheFunction()

    if disableEventHandler:
        eventHandler = CumulusNative.CumulusWorkerIgnoreEventHandler()
    else:
        eventHandler = CumulusNative.CumulusWorkerHoldEventsInMemoryEventHandler()

    return (
        CumulusNative.CumulusWorker(
            callbackSchedulerToUse,
            CumulusNative.CumulusWorkerConfiguration(
                machineId,
                threadCount,
                CumulusNative.CumulusCheckpointPolicy.None(),
                ExecutionContext.createContextConfiguration(),
                ""
                ),
            vdm,
            cache,
            eventHandler
            ),
        vdm,
        eventHandler
        )
开发者ID:nkhuyu,项目名称:ufora,代码行数:56,代码来源:InMemoryCumulusSimulation.py


示例7: createClient_

def createClient_(clientId, callbackSchedulerToUse = None):
    if callbackSchedulerToUse is None:
        callbackSchedulerToUse = CallbackScheduler.singletonForTesting()

    vdm = ForaNative.VectorDataManager(callbackSchedulerToUse, 5 * 1024 * 1024)
    vdm.setMemoryLimit(100 * 1024 * 1024, 125 * 1024 * 1024)

    return (
        CumulusNative.CumulusClient(vdm, clientId, callbackSchedulerToUse),
        vdm
        )
开发者ID:nkhuyu,项目名称:ufora,代码行数:11,代码来源:InMemoryCumulusSimulation.py


示例8: handle

    def handle(self):
        logging.info("all file descriptors closed")
        callbackScheduler = CallbackScheduler.createSimpleCallbackSchedulerFactory().createScheduler(
            "BackendGatewayService", 1
        )

        channel = SocketStringChannel.SocketStringChannel(callbackScheduler, self.sock).makeQueuelike(callbackScheduler)
        logging.info("channel connected")

        self.serviceRequest(channel)
        logging.info("Killing self!")
开发者ID:vishnur,项目名称:ufora,代码行数:11,代码来源:handleBackendGatewayConnection.py


示例9: setUp

    def setUp(self):
        self.callbackScheduler = CallbackScheduler.singletonForTesting()
        self.runtime = Runtime.getMainRuntime()
        self.axioms = self.runtime.getAxioms()
        self.compiler = self.runtime.getTypedForaCompiler()
        self.builtinsAsJOV = FORANative.JudgmentOnValue.Constant(FORA.builtin().implVal_)

        pyforaPath = os.path.join(os.path.split(pyfora.__file__)[0], "fora/purePython")
        self.purePythonAsJOV = FORANative.JudgmentOnValue.Constant(FORA.importModule(pyforaPath).implVal_)
        
        self.instructionGraph = self.runtime.getInstructionGraph()
        self.reasoner = FORANative.SimpleForwardReasoner(self.compiler, self.instructionGraph, self.axioms)
开发者ID:WantonSoup,项目名称:ufora,代码行数:12,代码来源:SimpleForwardReasoner_test.py


示例10: createService

def createService(args):
    callbackSchedulerFactory = CallbackScheduler.createSimpleCallbackSchedulerFactory()
    callbackScheduler = callbackSchedulerFactory.createScheduler('ufora-worker', 1)
    channelListener = MultiChannelListener(callbackScheduler,
                                           [args.base_port, args.base_port + 1])

    sharedStateViewFactory = ViewFactory.ViewFactory.TcpViewFactory(
        callbackSchedulerFactory.createScheduler('SharedState', 1),
        args.manager_address,
        int(args.manager_port)
        )

    channelFactory = TcpChannelFactory.TcpStringChannelFactory(callbackScheduler)

    diagnostics_dir = os.getenv("UFORA_WORKER_DIAGNOSTICS_DIR")
    eventHandler = diagnostics_dir and createEventHandler(
        diagnostics_dir,
        callbackSchedulerFactory.createScheduler("ufora-worker-event-handler", 1)
        )

    own_address = args.own_address or get_own_ip()
    print "Listening on", own_address, "ports:", args.base_port, "and", args.base_port+1

    config = Setup.config()
    print "RAM cache of %d / %d MB and %d threads. Track tcmalloc: %s" % (
        config.cumulusVectorRamCacheMB,
        config.cumulusMaxRamCacheMB,
        config.cumulusServiceThreadCount,
        config.cumulusTrackTcmalloc
        )

    print "Ufora store at %s:%s" % (args.manager_address, args.manager_port)

    s3InterfaceFactory = ActualS3Interface.ActualS3InterfaceFactory()
    print "PythonIoTasks threads: %d. Out of process: %s" % (
        config.externalDatasetLoaderServiceThreads,
        s3InterfaceFactory.isCompatibleWithOutOfProcessDownloadPool
        )

    return CumulusService.CumulusService(
        own_address,
        channelListener,
        channelFactory,
        eventHandler,
        callbackScheduler,
        diagnostics_dir,
        Setup.config(),
        viewFactory=sharedStateViewFactory,
        s3InterfaceFactory=s3InterfaceFactory,
        objectStore=NullObjectStore.NullObjectStore()
        )
开发者ID:ufora,项目名称:ufora,代码行数:51,代码来源:ufora-worker.py


示例11: setUp

    def setUp(self):
        self.callbackScheduler = CallbackScheduler.singletonForTesting()

        def createStorage(vdm):
            self.simpleOfflineCache = CumulusNative.SimpleOfflineCache(self.callbackScheduler, 1000000000)
            return self.simpleOfflineCache

        self.evaluator = LocalEvaluator.LocalEvaluator(
            createStorage,
            2000000,
            maxPageSizeInBytes = 100000
            )

        self.oldEvaluator = Evaluator.swapEvaluator(self.evaluator)
开发者ID:Sandy4321,项目名称:ufora,代码行数:14,代码来源:VectorDataManager_test.py


示例12: createWorkersAndClients

def createWorkersAndClients(
            workerCount,
            clientCount,
            viewFactory = None,
            memoryLimitMb = 100,
            threadCount = 2,
            callbackSchedulerToUse = None
            ):
    if callbackSchedulerToUse is None:
        callbackSchedulerToUse = CallbackScheduler.singletonForTesting()

    if viewFactory is None:
        viewFactory = createInMemorySharedStateViewFactory(callbackSchedulerToUse)

    workersVdmsAndEventHandlers = [
        createWorker(
            machineId(ix),
            viewFactory,
            memoryLimitMb = memoryLimitMb,
            threadCount=threadCount,
            callbackSchedulerToUse = callbackSchedulerToUse
            ) for ix in range(workerCount)
        ]

    clientsAndVdms = [
        createClient(
            clientId(ix),
            callbackSchedulerToUse = callbackSchedulerToUse
            )
        for ix in range(clientCount)
        ]

    for ix1 in range(len(workersVdmsAndEventHandlers)):
        workersVdmsAndEventHandlers[ix1][0].startComputations()

    for ix1 in range(len(workersVdmsAndEventHandlers)-1):
        for ix2 in range(ix1 + 1, len(workersVdmsAndEventHandlers)):
            worker1Channel1, worker2Channel1 = StringChannelNative.InMemoryStringChannel(callbackSchedulerToUse)
            worker1Channel2, worker2Channel2 = StringChannelNative.InMemoryStringChannel(callbackSchedulerToUse)
            workersVdmsAndEventHandlers[ix1][0].addMachine(machineId(ix2), [worker1Channel1, worker1Channel2], ForaNative.ImplValContainer(), callbackSchedulerToUse)
            workersVdmsAndEventHandlers[ix2][0].addMachine(machineId(ix1), [worker2Channel1, worker2Channel2], ForaNative.ImplValContainer(), callbackSchedulerToUse)

    for ix1 in range(len(workersVdmsAndEventHandlers)):
        for ix2 in range(len(clientsAndVdms)):
            workerChannel1, clientChannel1 = StringChannelNative.InMemoryStringChannel(callbackSchedulerToUse)
            workerChannel2, clientChannel2 = StringChannelNative.InMemoryStringChannel(callbackSchedulerToUse)
            workersVdmsAndEventHandlers[ix1][0].addCumulusClient(clientId(ix2), [workerChannel1, workerChannel2], ForaNative.ImplValContainer(), callbackSchedulerToUse)
            clientsAndVdms[ix2][0].addMachine(machineId(ix1), [clientChannel1, clientChannel2], ForaNative.ImplValContainer(), callbackSchedulerToUse)

    return workersVdmsAndEventHandlers, clientsAndVdms, viewFactory
开发者ID:WantonSoup,项目名称:ufora,代码行数:50,代码来源:PythonTestUtilities.py


示例13: __init__

    def __init__(self, socketFd, sharedStateAddress):
        self.socketFd = socketFd
        self.callbackSchedulerFactory = CallbackScheduler.createSimpleCallbackSchedulerFactory()

        self.scheduler = self.callbackSchedulerFactory.createScheduler("BackendGatewayRequestHandler", 1)

        sharedStateHost, sharedStatePort = sharedStateAddress.split(":")
        sharedStateViewFactory = ViewFactory.ViewFactory.TcpViewFactory(
            self.callbackSchedulerFactory.createScheduler("SharedState", 1), sharedStateHost, int(sharedStatePort)
        )

        self.subscribableHandler = ConnectionHandler.ConnectionHandler(
            self.scheduler, sharedStateViewFactory, lambda: TcpChannelFactory.TcpStringChannelFactory(self.scheduler)
        )
        self.sock = socket.fromfd(socketFd, socket.AF_INET, socket.SOCK_STREAM)
开发者ID:vishnur,项目名称:ufora,代码行数:15,代码来源:handleBackendGatewayConnection.py


示例14: __init__

    def __init__(self,
            inMemory,
            port = None,
            cachePathOverride = '',
            maxOpenFiles = 256,
            inMemChannelFactoryFactory = None,
            maxLogFileSizeMb = 10,
            pingInterval = None):

        self.inMemory = inMemory
        self.manager = None
        self.callbackScheduler = CallbackScheduler.singletonForTesting()

        if self.inMemory:
            self.manager = SharedStateService.KeyspaceManager(
                10001,
                1,
                cachePathOverride=cachePathOverride,
                pingInterval = IN_MEMORY_HARNESS_PING_INTERVAL if pingInterval is None else pingInterval,
                maxOpenFiles=maxOpenFiles,
                maxLogFileSizeMb=maxLogFileSizeMb
                )

            #although named otherwise InMemoryChannelFactory is actually a factory for a channelFactory
            # or a channelFactoryFactory

            channelFactoryFactory = inMemChannelFactoryFactory if inMemChannelFactoryFactory is not None \
                    else InMemoryChannelFactory.InMemoryChannelFactory

            logging.info(channelFactoryFactory)
            self.channelFactory = channelFactoryFactory(self.callbackScheduler, self.manager)
            self.viewFactory = ViewFactory.ViewFactory(self.channelFactory)
        else:
            class Settings(object):
                callbackScheduler = self.callbackScheduler

            assert port is not None

            self.service = SharedStateService.SharedStateService(
                    self.callbackScheduler,
                    cachePathOverride=cachePathOverride,
                    port=port
                    )

            self.service.startService()
            self.service.blockUntilListening()

            self.viewFactory = ViewFactory.ViewFactory.TcpViewFactory(self.callbackScheduler, "localhost", port)
开发者ID:ufora,项目名称:ufora,代码行数:48,代码来源:SharedStateTestHarness.py


示例15: __init__

    def __init__(self,
            cumulusVectorRamCacheSizeOverride = DEFAULT_VECTOR_RAM_CACHE_SIZE,
            cumulusMaxRamCacheSizeOverride = DEFAULT_MAX_RAM_CACHE_SIZE,
            cumulusThreadCountOverride = DEFAULT_THREAD_COUNT,
            remoteGatewayRamCacheSizeOverride = DEFAULT_MAX_RAM_CACHE_SIZE,
            perMachineThroughput = DEFAULT_PER_MACHINE_THROUGHPUT
            ):
        self.cumulusMaxRamCacheSizeOverride = cumulusMaxRamCacheSizeOverride
        self.cumulusVectorRamCacheSizeOverride = cumulusVectorRamCacheSizeOverride

        self.callbackSchedulerFactory = CallbackScheduler.createSimpleCallbackSchedulerFactory()
        self.callbackScheduler = self.callbackSchedulerFactory.createScheduler("InMemoryCluster", 1)

        self.cumulusThreadCountOverride = cumulusThreadCountOverride
        self.remoteGatewayCacheSize = remoteGatewayRamCacheSizeOverride

        self.sharedStateManager = SharedStateService.KeyspaceManager(
            10001,
            1,
            cachePathOverride="",
            pingInterval = IN_MEMORY_CLUSTER_SS_PING_INTERVAL,
            maxOpenFiles=100
            )

        self.sharedStateChannelFactory = (
            InMemorySharedStateChannelFactory.InMemoryChannelFactory(
                self.callbackScheduler,
                self.sharedStateManager
                )
            )

        self.sharedStateViewFactory = ViewFactory.ViewFactory(self.sharedStateChannelFactory)

        self.client = InMemoryClient(self)
        self.cumuli = []
        self.nextCumulusAddress = 0

        self.channelManager = InMemoryChannelManager(self.callbackScheduler, perMachineThroughput)

        self.inMemoryDemuxingChannel = \
            InMemorySharedStateChannelFactory.SerializedToManagerChannelFactory(
                self.callbackScheduler,
                self.sharedStateManager,
                "SharedState"
                )
开发者ID:WantonSoup,项目名称:ufora,代码行数:45,代码来源:InMemoryCluster.py


示例16: setUp

    def setUp(self):
        self.callbackScheduler = CallbackScheduler.singletonForTesting()
        self.runtime = Runtime.getMainRuntime()
        self.axioms = self.runtime.getAxioms()
        self.native_runtime = self.runtime.getTypedForaCompiler()
        self.vals_to_test = self.loadValuesFromFile(os.path.join(os.path.split(__file__)[0],
                                                        "AxiomJOA_test.txt"))

        self.evaluator = LocalEvaluator.LocalEvaluator(
                            lambda vdm: CumulusNative.SimpleOfflineCache(self.callbackScheduler, 1000000000),
                            10000000,
                            maxPageSizeInBytes = 100000
                            )
        self.oldEvaluator = Evaluator.swapEvaluator(self.evaluator)

        self.knownModulesAsConstantJOVs = dict()
        self.knownModulesAsConstantJOVs["builtin"] = \
                FORANative.JudgmentOnValue.Constant(FORA.builtin().implVal_)
开发者ID:Sandy4321,项目名称:ufora,代码行数:18,代码来源:AxiomJOA_test.py


示例17: createInMemorySharedStateViewFactory

def createInMemorySharedStateViewFactory(callbackSchedulerToUse = None):
    if callbackSchedulerToUse is None:
        callbackSchedulerToUse = CallbackScheduler.singletonForTesting()

    sharedStateManager = SharedStateService.KeyspaceManager(
        10001,
        1,
        cachePathOverride="",
        pingInterval = IN_MEMORY_CLUSTER_SS_PING_INTERVAL,
        maxOpenFiles=100
        )

    sharedStateChannelFactory = (
        InMemorySharedStateChannelFactory.InMemoryChannelFactory(
            callbackSchedulerToUse.getFactory().createScheduler("SharedState", 1),
            sharedStateManager
            )
        )

    return ViewFactory.ViewFactory(sharedStateChannelFactory)
开发者ID:nkhuyu,项目名称:ufora,代码行数:20,代码来源:InMemoryCumulusSimulation.py


示例18: initialize

def initialize(setupObjectToUse=None, useLocalEvaluator=True, vdmOverride=None):
    global _evaluator

    if _evaluator is not None:
        return

    import ufora.FORA.python.Evaluator.LocalEvaluator as LocalEvaluator
    import ufora.FORA.python.Evaluator.CumulusEvaluator as CumulusEvaluator

    if setupObjectToUse is None:
        configToUse = Setup.config()
    else:
        configToUse = setupObjectToUse.config

    if useLocalEvaluator:
        _evaluator = LocalEvaluator.defaultLocalEvaluator(vdmOverride=vdmOverride)
    else:
        import ufora.native.CallbackScheduler as CallbackSchedulerNative
        schedulerFactory = CallbackSchedulerNative.createSimpleCallbackSchedulerFactory()
        _evaluator = CumulusEvaluator.CumulusEvaluator(
            schedulerFactory.createScheduler("CumulusEvaluator", 1)
            )
开发者ID:Sandy4321,项目名称:ufora,代码行数:22,代码来源:Evaluator.py


示例19: createWorker

def createWorker(machineId, viewFactory, callbackSchedulerToUse = None, threadCount = 2, memoryLimitMb = 100):
    if callbackSchedulerToUse is None:
        callbackSchedulerToUse = CallbackScheduler.singletonForTesting()

    vdm = ForaNative.VectorDataManager(callbackSchedulerToUse, 5 * 1024 * 1024)
    vdm.setMemoryLimit(
        int(memoryLimitMb * 1024 * 1024),
        min(int(memoryLimitMb * 1.25 * 1024 * 1024),
            int((memoryLimitMb + 1024 * 2) * 1024 * 1024))
        )

    vdm.setPersistentCacheIndex(
        CumulusNative.PersistentCacheIndex(
            viewFactory.createView(),
            callbackSchedulerToUse
            )
        )

    cache = CumulusNative.SimpleOfflineCache(callbackSchedulerToUse, 1000 * 1024 * 1024)

    eventHandler = CumulusNative.CumulusWorkerHoldEventsInMemoryEventHandler()

    return (
        CumulusNative.CumulusWorker(
            callbackSchedulerToUse,
            CumulusNative.CumulusWorkerConfiguration(
                machineId,
                threadCount,
                CumulusNative.CumulusCheckpointPolicy.None(),
                ExecutionContext.createContextConfiguration(),
                ""
                ),
            vdm,
            cache,
            eventHandler
            ),
        vdm,
        eventHandler
        )
开发者ID:WantonSoup,项目名称:ufora,代码行数:39,代码来源:PythonTestUtilities.py


示例20: __init__

    def __init__(self):
        callbackSchedulerFactory = CallbackScheduler.createSimpleCallbackSchedulerFactory()
        self.callbackScheduler = callbackSchedulerFactory.createScheduler("Simulator", 1)

        self.uforaPath = os.path.abspath(os.path.join(os.path.dirname(__file__), '../'))

        self.sharedStatePath = os.path.join(self.uforaPath, 'distributed/SharedState')
        self.sharedStateMainline = os.path.join(self.sharedStatePath, 'sharedStateMainline.py')

        self.gatewayServiceMainline = os.path.join(self.uforaPath, 'scripts/init/ufora-gateway.py')

        self.webPath = os.path.join(self.uforaPath, 'web/relay')
        self.relayScript = os.path.join(self.webPath, 'server.coffee')

        self.relayPort = Setup.config().relayPort
        self.relayHttpsPort = Setup.config().relayHttpsPort
        self.sharedStatePort = Setup.config().sharedStatePort
        self.restApiPort = Setup.config().restApiPort
        self.subscribableWebObjectsPort = Setup.config().subscribableWebObjectsPort


        self.desirePublisher = None
        self._connectionManager = None
开发者ID:nkhuyu,项目名称:ufora,代码行数:23,代码来源:ClusterSimulation.py



注:本文中的ufora.native.CallbackScheduler类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python native.FORA类代码示例发布时间:2022-05-27
下一篇:
Python test.InMemoryCumulusSimulation类代码示例发布时间:2022-05-27
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap