def dispatch(self, method_frame):
        '''
        Dispatch a method for this protocol.
        '''
        method = self.dispatch_map.get(method_frame.method_id)
        if method:
            callback = self.channel.clear_synchronous_cb(method)
            callback(method_frame)
        else:
            raise self.InvalidMethod(
                "no method is registered with id: %d" % method_frame.method_id)
def dispatch ( self , method_frame ) : method = self . dispatch_map . get ( method_frame . method_id ) if method : callback = self . channel . clear_synchronous_cb ( method ) callback ( method_frame ) else : raise self . InvalidMethod ( "no method is registered with id: %d" % method_frame . method_id )
Dispatch a method for this protocol.