【问题标题】:storing python function in distributed computer在分布式计算机中存储python函数
【发布时间】:2011-06-06 17:24:07
【问题描述】:

终于对tornadoweb异步有点了解了

异步响应的关键是

def new_messages(self, messages):
    cls = MessageMixin
    logging.info("Sending new message to %r listeners", len(cls.waiters))
    for callback in cls.waiters:
        try:
            callback(messages)
        except:
            logging.error("Error in waiter callback", exc_info=True)
    cls.waiters = []

so 有没有办法将回调函数存储在数据存储区中 或解决方案,如果使用多台计算机或进程??

例如: 对 node1 的请求更新 B 为 A 发布由 node2 处理的数据

node2如何调用node1回调??

【问题讨论】:

    标签: python tornado


    【解决方案1】:

    什么?!您只能对具有数据存储的消息队列进行回调。研究鼠兔或胡萝卜。没有办法“存储”回调,但您可以定义一种方法让其他计算机为您执行函数并将结果反馈给原始计算机。

    【讨论】:

      猜你喜欢
      • 2014-09-07
      • 2019-07-19
      • 2011-06-28
      • 1970-01-01
      • 2011-09-06
      • 2012-03-31
      • 2011-11-06
      • 2017-05-11
      • 1970-01-01
      相关资源
      最近更新 更多