def msg_reply(conf, msg_id, reply_q, connection_pool, reply=None, failure=None, ending=False, log_failure=True):
 with ConnectionContext(conf, connection_pool) as conn:
  if failure:
   failure = rpc_common.serialize_remote_exception(failure, log_failure)
  try:
   msg = {'result': reply, 'failure': failure}
  except TypeError:
   msg = {'result': dict(((k, repr(v)) for (k, v) in reply.__dict__.iteritems())), 'failure': failure}
  if ending:
   msg['ending'] = True
  _add_unique_id(msg)
  if reply_q:
   msg['_msg_id'] = msg_id
   conn.direct_send(reply_q, rpc_common.serialize_msg(msg))
  else:
   conn.direct_send(msg_id, rpc_common.serialize_msg(msg))

def msg_reply ( conf , msg_id , reply_q , connection_pool , reply = None , failure = None , ending = False , log_failure = True ) : with ConnectionContext ( conf , connection_pool ) as conn : if failure : failure = rpc_common . serialize_remote_exception ( failure , log_failure ) try : msg = { 'result' : reply , 'failure' : failure } except TypeError : msg = { 'result' : dict ( ( ( k , repr ( v ) ) for ( k , v ) in reply . __dict__ . iteritems ( ) ) ) , 'failure' : failure } if ending : msg [ 'ending' ] = True _add_unique_id ( msg ) if reply_q : msg [ '_msg_id' ] = msg_id conn . direct_send ( reply_q , rpc_common . serialize_msg ( msg ) ) else : conn . direct_send ( msg_id , rpc_common . serialize_msg ( msg ) )
sends a reply or an error on the channel signified by msg_id .