def send_message(self, message, callback):
if self.__callback is not None:<EOL><INDENT>raise ProgrammingError('<STR_LIT>')<EOL><DEDENT>if callback:<EOL><INDENT>err_callback = functools.partial(callback, None)<EOL><DEDENT>else:<EOL><INDENT>err_callback = None<EOL><DEDENT>for job in self.__job_queue:<EOL><INDENT>if isinstance(job, asyncjobs.AsyncJob):<EOL><INDENT>job.update_err_callback(err_callback)<EOL><DEDENT><DEDENT>if not self.__alive:<EOL><INDENT>if self.__autoreconnect:<EOL><INDENT>self.__connect(err_callback)<EOL><DEDENT>else:<EOL><INDENT>raise InterfaceError('<STR_LIT>')<EOL><DEDENT><DEDENT>self._put_job(asyncjobs.AsyncMessage(self, message, callback), <NUM_LIT:0>)<EOL>self._next_job()<EOL>
send a message over the wire; callback=None indicates a safe=False call where we write and forget about it