def send(source, queue, shutdown=None):
    """Send records from a source to a queue.

    Parameters
    ----------
    source: :ref:`Record generator <record-generators>`, required
    queue: :class:`queue.Queue`, required
    shutdown: :class:`threading.Event`, optional.
        Set the event to safely stop sending from another thread.
    """
    for record in source:
        queue.put(record)
        if shutdown and shutdown.isSet():
            return
    queue.put(StopIteration)
