【问题标题】:What is twisted's equivalent of tornado's IOLoop.add_callback?什么是tornado 的IOLoop.add_callback 的twisted 等价物?
【发布时间】:2010-08-09 21:34:39
【问题描述】:

我正在尝试调整一些 tornado 代码以使用 twisted。

Tornado 的 IOLoop 有一个函数 (add_callback),它本质上会在循环的下一次迭代中调用该函数。据我所知,twisted 没有直接的翻译。有什么办法可以在twisted中模拟这个吗?

【问题讨论】:

    标签: python twisted tornado


    【解决方案1】:

    reactor.callLater(0, x)reactor.callFromThread(x)

    【讨论】:

    • 也称为 twistedmatrix.com/documents/10.1.0/api/…> 和 twistedmatrix.com/documents/10.1.0/api/…>。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2012-03-26
    • 2014-06-12
    • 1970-01-01
    • 2022-11-28
    • 2014-05-08
    • 2018-07-10
    • 2023-04-10
    相关资源
    最近更新 更多