<s> from stormed . util import add_method , logger <EOL> from stormed . method . codegen . basic import * <EOL> @ add_method ( GetOk ) <EOL> def handle ( self , ch ) : <EOL> msg = ch . message <EOL> msg . rx_channel = ch <EOL> ch . invoke_callback ( msg ) <EOL> @ add_method ( GetEmpty ) <EOL> def handle ( self , ch ) : <EOL> ch . invoke_callback ( None ) <EOL> @ add_method ( ConsumeOk ) <EOL> def handle ( self , ch ) : <EOL> ch . invoke_callback ( self . consumer_tag ) <EOL> @ add_method ( CancelOk ) <EOL> def handle ( self , ch ) : <EOL> del ch . consumers [ self . consumer_tag ] <EOL> @ add_method ( Deliver ) <EOL> def handle ( self , ch ) : <EOL> msg = ch . message <EOL> msg . rx_channel = ch <EOL> ch . consumers [ self . consumer_tag ] . callback ( msg ) <EOL> @ add_method ( Return ) <EOL> def handle ( self , ch ) : <EOL> msg = ch . message <EOL> msg . rx_channel = ch <EOL> if ch . on_return : <EOL> try : <EOL> ch . on_return ( msg ) <EOL> except Exception : <EOL> logger . error ( '<STR_LIT>' , exc_info = True ) </s>
