当前位置: 首页>>代码示例>>Python>>正文


Python defer.execute方法代码示例

本文整理汇总了Python中twisted.internet.defer.execute方法的典型用法代码示例。如果您正苦于以下问题:Python defer.execute方法的具体用法?Python defer.execute怎么用?Python defer.execute使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在twisted.internet.defer的用法示例。


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

示例1: __getattr__

# 需要导入模块: from twisted.internet import defer [as 别名]
# 或者: from twisted.internet.defer import execute [as 别名]
def __getattr__(self, name):
        """
        Pass attributes through to the real L{BrokerServer}, after checking
        that they're encodable with AMP.
        """
        original = getattr(self.broker_server, name, None)
        if (name in get_remote_methods(self.broker_server) and
            original is not None and
            callable(original)
            ):
            def method(*args, **kwargs):
                for arg in args:
                    assert MethodCallArgument.check(arg)
                for k, v in iteritems(kwargs):
                    assert MethodCallArgument.check(v)
                return execute(original, *args, **kwargs)
            return method
        else:
            raise AttributeError(name) 
开发者ID:CanonicalLtd,项目名称:landscape-client,代码行数:21,代码来源:amp.py

示例2: listen

# 需要导入模块: from twisted.internet import defer [as 别名]
# 或者: from twisted.internet.defer import execute [as 别名]
def listen(self, stdioProtocolFactory):
        """
        Implement L{IStreamServerEndpoint.listen} to listen on stdin/stdout
        """
        return defer.execute(self._stdio,
                             stdioProtocolFactory.buildProtocol(PipeAddress()),
                             reactor=self._reactor) 
开发者ID:proxysh,项目名称:Safejumper-for-Desktop,代码行数:9,代码来源:endpoints.py

示例3: listen

# 需要导入模块: from twisted.internet import defer [as 别名]
# 或者: from twisted.internet.defer import execute [as 别名]
def listen(self, factory):
        """Implement IStreamServerEndpoint.listen to listen on TCP.

        Optionally configuring TLS behind the HAProxy protocol.

        """
        if self._ssl_cf:
            factory = TLSMemoryBIOFactory(self._ssl_cf, False, factory)
        proxyf = self.wrapper_factory(factory)
        return defer.execute(self._listen, self._port, proxyf, **self._kwargs) 
开发者ID:mozilla-services,项目名称:autopush,代码行数:12,代码来源:haproxy.py

示例4: listen

# 需要导入模块: from twisted.internet import defer [as 别名]
# 或者: from twisted.internet.defer import execute [as 别名]
def listen(self, protocolFactory):
        """
        Implement L{IStreamServerEndpoint.listen} to listen on a TCP socket
        """
        return defer.execute(self._reactor.listenTCP,
                             self._port,
                             protocolFactory,
                             backlog=self._backlog,
                             interface=self._interface) 
开发者ID:kuri65536,项目名称:python-for-android,代码行数:11,代码来源:endpoints.py

示例5: loadModel

# 需要导入模块: from twisted.internet import defer [as 别名]
# 或者: from twisted.internet.defer import execute [as 别名]
def loadModel(self, path, request):
        """Load a model, for the given path and request.

        @rtype: L{Deferred}
        """
        from twisted.internet.defer import execute
        return execute(self.loadModelNow, path, request) 
开发者ID:kenorb-contrib,项目名称:BitTorrent,代码行数:9,代码来源:tapestry.py


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