當前位置: 首頁>>代碼示例>>Python>>正文


Python server.ThreadedServer方法代碼示例

本文整理匯總了Python中rpyc.utils.server.ThreadedServer方法的典型用法代碼示例。如果您正苦於以下問題:Python server.ThreadedServer方法的具體用法?Python server.ThreadedServer怎麽用?Python server.ThreadedServer使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在rpyc.utils.server的用法示例。


在下文中一共展示了server.ThreadedServer方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: start_daemon

# 需要導入模塊: from rpyc.utils import server [as 別名]
# 或者: from rpyc.utils.server import ThreadedServer [as 別名]
def start_daemon(port=DEFAULT_PORT):

    try:
        from ..logic import GlobalInfo
        GlobalInfo.daemon_inst = SingleInstance()
    except SingleInstanceException:
        return

    # load plugins in headless mode
    from ..plugins import PluginManager
    GlobalInfo.headless_plugin_manager = PluginManager(None)
    GlobalInfo.headless_plugin_manager.discover_and_initialize_plugins()

    # start the server
    server = ThreadedServer(ManagementService, port=port, protocol_config={'allow_public_attrs': True})
    threading.Thread(target=monitor_thread, args=(server, ), daemon=True).start()
    server.start() 
開發者ID:angr,項目名稱:angr-management,代碼行數:19,代碼來源:server.py

示例2: get_server

# 需要導入模塊: from rpyc.utils import server [as 別名]
# 或者: from rpyc.utils.server import ThreadedServer [as 別名]
def get_server(listen_config, scheduler, SchedulerServiceClass=None):
    # 額外構造函數參數
    ser_args = ['test args']
    ser_kwargs = {}
    # 傳遞Service構造函數參數
    SSC = SchedulerServiceClass if SchedulerServiceClass is not None else SchedulerService
    service = classpartial(SSC, scheduler, *ser_args, **ser_kwargs)
    # 允許屬性訪問
    protocol_config = {'allow_public_attrs': True}
    # 實例化RPYC服務器
    server = ThreadedServer(service,  protocol_config=protocol_config, **listen_config)
    return server 
開發者ID:gsw945,項目名稱:schedule-system,代碼行數:14,代碼來源:server.py

示例3: server_launch

# 需要導入模塊: from rpyc.utils import server [as 別名]
# 或者: from rpyc.utils.server import ThreadedServer [as 別名]
def server_launch(service, ip, port, config):
    """
    Target for the multiprocessing Pycryptoki service.

    :param service:
    :param ip:
    :param port:
    :param config:
    :return:
    """
    t = ThreadedServer(service, hostname=ip, port=port, protocol_config=config)
    t.start() 
開發者ID:ThalesGroup,項目名稱:pycryptoki,代碼行數:14,代碼來源:rpyc_pycryptoki.py

示例4: remote_service_operator

# 需要導入模塊: from rpyc.utils import server [as 別名]
# 或者: from rpyc.utils.server import ThreadedServer [as 別名]
def remote_service_operator(DATA):
        """
        starts the (threaded) service which exposes the 
        RPYC_service factory class to remote RPYC clients.
            
        This is the function which should be called in the main function,
        there is no need for hiding it in a class.
        """
        CS  = CustomizedService(DATA)
        t = ThreadedServer(CS, port = DATA.localhost.port)#, protocol_config = {"allow_public_attrs" : True})
        t.start() 
開發者ID:qkitgroup,項目名稱:qkit,代碼行數:13,代碼來源:srv_thread.py


注:本文中的rpyc.utils.server.ThreadedServer方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。