<commit_before><commit_msg>First draft of a background thread to monitor connections.<commit_after>import threading
import time


class Monitor(object):

    def __init__(self, cm, transport):
        self._cm = cm
        self._transport = transport

        self._stop_loop = False
        self._thread = threading.Thread(target=self._run)

        self._periodic = 0.050  # 50 msec

    def start(self):
        self._thread.start()

    def terminate(self):
        self._stop_loop = True
        self._thread.join()

    def _run(self):
        while not self._stop_loop:
            ### look for changes in the ring servers

            ### see if some offline servers came back

            time.sleep(self._periodic)
{'fraction_non_alphanumeric': 0.08701657458563536, 'fraction_numerical': 0.008287292817679558, 'mean_word_length': 2.310502283105023, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5688299', 'n_tokens_mistral': 208, 'n_tokens_neox': 189, 'n_words': 58}