(self, index, period=60, limit=10, writerargs=None,
                 commitargs=None)
:param index: the :class:`whoosh.index.Index` to write to.
        :param period: the maximum amount of time (in seconds) between commits.
            Set this to ``0`` or ``None`` to not use a timer. Do not set this
            any lower than a few seconds.
        :param limit: the maximum number of documents to buffer before
            committing.
        :param writerargs: dictionary specifying keyword arguments to be passed
            to the index's ``writer()`` method when creating a writer.
:param index: the :class:`whoosh.index.Index` to write to.
        :param period: the maximum amount of time (in seconds) between commits.
            Set this to ``0`` or ``None`` to not use a timer. Do not set this
            any lower than a few seconds.
        :param limit: the maximum number of documents to buffer before
            committing.
        :param writerargs: dictionary specifying keyword arguments to be passed
            to the index's ``writer()`` method when creating a writer.
: param index : the : class : whoosh . index . Index to write to . : param period : the maximum amount of time ( in seconds ) between commits . Set this to 0 or None to not use a timer . Do not set this any lower than a few seconds . : param limit : the maximum number of documents to buffer before committing . : param writerargs : dictionary specifying keyword arguments to be passed to the index s writer () method when creating a writer .
def __init__(self, index, period=60, limit=10, writerargs=None,
                 commitargs=None):
        """
        :param index: the :class:`whoosh.index.Index` to write to.
        :param period: the maximum amount of time (in seconds) between commits.
            Set this to ``0`` or ``None`` to not use a timer. Do not set this
            any lower than a few seconds.
        :param limit: the maximum number of documents to buffer before
            committing.
        :param writerargs: dictionary specifying keyword arguments to be passed
            to the index's ``writer()`` method when creating a writer.
        """

        self.index = index
        self.period = period
        self.limit = limit
        self.writerargs = writerargs or {}
        self.commitargs = commitargs or {}

        self.lock = threading.RLock()
        self.writer = self.index.writer(**self.writerargs)

        self._make_ram_index()
        self.bufferedcount = 0

        # Start timer
        if self.period:
            self.timer = threading.Timer(self.period, self.commit)
            self.timer.start()
def __init__ ( self , index , period = 60 , limit = 10 , writerargs = None , commitargs = None ) : self . index = index self . period = period self . limit = limit self . writerargs = writerargs or { } self . commitargs = commitargs or { } self . lock = threading . RLock ( ) self . writer = self . index . writer ( * * self . writerargs ) self . _make_ram_index ( ) self . bufferedcount = 0 # Start timer if self . period : self . timer = threading . Timer ( self . period , self . commit ) self . timer . start ( )