def __init__(self, host, port=<NUM_LIT>, prefix=None, timeout=<NUM_LIT:5>, interval=None,<EOL>queue_size=None, log_sends=False, protocol='<STR_LIT>', batch_size=<NUM_LIT:1000>):
self.host = host<EOL>self.port = port<EOL>self.prefix = prefix<EOL>self.timeout = timeout<EOL>self.interval = interval<EOL>self.log_sends = log_sends<EOL>self.protocol = protocol<EOL>self.batch_size = batch_size<EOL>if self.interval is not None:<EOL><INDENT>if queue_size is None:<EOL><INDENT>queue_size = int(round(interval)) * <NUM_LIT:100><EOL><DEDENT>self._queue = queue.Queue(maxsize=queue_size)<EOL>self._thread = threading.Thread(target=self._thread_loop)<EOL>self._thread.daemon = True<EOL>self._thread.start()<EOL>atexit.register(self.stop)<EOL><DEDENT>
Initialize a Sender instance, starting the background thread to
        send messages at given interval (in seconds) if "interval" is not
        None. Send at most "batch_size" messages per socket send operation (default=1000).
        Default protocol is TCP; use protocol='udp' for UDP.