'This method is called by the user interface layer, when the user
"clicks" on the stop button.
:return: None. The stop method can take some seconds to return.'

def stop(self):

    om.out.debug('The    user    stopped    the    core,    finishing    threads...')
    self.uri_opener.stop()
    if (self.strategy is not None):
        self.strategy.stop()
    stop_start_time = time.time()
    wait_max = 10
    loop_delay = 0.5
    for _ in xrange(int((wait_max / loop_delay))):
        if (not self.status.is_running()):
            core_stop_time = epoch_to_string(stop_start_time)
            msg = ('%s    were    needed    to    stop    the    core.' % core_stop_time)
            break
        try:
            time.sleep(loop_delay)
        except KeyboardInterrupt:
            msg = 'The    user    cancelled    the    cleanup    process,    forcing    exit.'
            break
    else:
        msg = 'The    core    failed    to    stop    in    %s    seconds,    forcing    exit.'
        msg %= wait_max
    om.out.debug(msg)
    self.worker_pool.terminate_join()
