storing python function in distributed computer
finally I a little understand about tornadoweb asynchronous
the key of asynchronous response is
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 Is there any solution to store the callback function in datastore or solution if using several computer or process??
e.g : A requ开发者_开发知识库est updates to node1 B post data for A that handled by node2
how to node2 call node1 callback??
What?! You can only do callbacks with a message queue that has a data store. Look into something pika or Carrot. There's no way to "store" the callback but you can define a way to make other computers execute functions for you and have the results fed back to the original computer.
精彩评论