def __init__(self, encoder=EliotJSONEncoder):
        """
        @param encoder: A JSONEncoder subclass to use when encoding JSON.
        """
        self._lock = Lock()
        self._encoder = encoder
        self.reset()