异步等待,直到调用了回调(python)

时间:2019-06-06 08:17:43

标签: python asynchronous async-await

我有看起来像这样的python代码:

def execute_callback(self, goal_handle):
    #This is a callback function from the action server
    #-------do something-----

    #publishing a message
    self._cur_location_publisher.publish(msg)

    # Now should wait until below callback is called

    #update result
    return result

def listener_callback(self, msg):
    # called when result from other node is subscribed
    #-----manipulate result---------- 

如何等待调用回调,然后继续在execute_callback中更新结果? 我正在使用python 3.6.2

0 个答案:

没有答案