Notifies handler on stream recording stop
12265
private void notifyRecordingStop() {
        IStreamAwareScopeHandler handler = getStreamAwareHandler();
        if (handler != null) {
            try {
                handler.streamRecordStop(this);
            } catch (Throwable t) {
                log.error("Error in notifyRecordingStop", t);
            }
        }
    }
194824
def register_stop(self, task, event_details=None):
		
		if self.record_stop() is True:
			record_type = WTrackerEvents.stop
			record = WSimpleTrackerStorage.Record(record_type, task, event_details=event_details)
			self.__store_record(record)
932847
function(time) {
    var self = this;
    self.eventDetection.recordRelease(time);

    if (self.eventDetection.isLongPress()) {
      // this is a "long-press" -  reset detection states and notify the "long-press" observers
      self.eventDetection.reset();
      self._notifyObservers(self.onLongPressCallbackRegistry);
    } else {
      if (self.eventDetection.onReleaseCount >= 2) {
        // this is a double-press (or more) event, so notify the "double-press" observers
        self.eventDetection.reset();
        self._notifyObservers(self.onDoublePressCallbackRegistry);
      }

      setTimeout(function(){
        if (self.eventDetection.onReleaseCount == 1) {
          // second press did not occur within the allotted time, so notify the "short-press" observers
          self.eventDetection.reset();
          self._notifyObservers(self.onShortPressCallbackRegistry);
        }
      }, 300); // @-@:p0 make this configurable?
    }
  }
1185569
def _stop_handler(self, handler):
        
        try:
            yield from handler.stop()
        except Exception as e:
            self.logger.error(e)
1160593
def monitor(self, listener):
        
        for line in self._stream():
            self._record.append(line)
            if self.verbose:
                self.out.blather(line)
            if listener(line) is self.MONITOR_STOP:
                return
1176395
public final void stopCapture() {
		synchronized (this) {
			// make sure we are running
			if ((state == STATE_STOPPED) || (state == STATE_ABOUT_TO_STOP))
				//throw new StateException("The capture is about to stop");
				return;

			// update our state
			state = STATE_ABOUT_TO_STOP;
		}
		
		if (thread.isAlive()) {
			thread.interrupt();
			
			// wait for thread to exit if the push thread is not the one
			// trying to join
			if (! Thread.currentThread().equals(thread)) {
				while (state == STATE_ABOUT_TO_STOP) {
					try {
						// wait for thread to exit
						thread.join();
						//thread = null;
					} catch (InterruptedException e) {
						// interrupted while waiting for the thread to join
						// keep waiting
						// System.err.println("interrupted while waiting for frame pusher thread to complete");
						// e.printStackTrace();
						// throw new StateException("interrupted while waiting for frame pusher thread to complete", e);
					}
				}
			}
			
		}
	}
147392
def get_stream_handler(stream=sys.stderr, level=logging.INFO,
                       log_format=log_formats.easy_read):
    
    sh = logging.StreamHandler(stream)
    sh.setLevel(level)
    sh.setFormatter(logging.Formatter(log_format))
    return sh
1097582
protected void sendRecordingStartedNotification(Session session, Recording recording) {
		this.recordingManager.getSessionEventsHandler().sendRecordingStartedNotification(session, recording);
	}
69972
def _signal_handler(self, signal_interupt, frame):  # pylint: disable=W0613
        """"""
        call_file = os.path.basename(inspect.stack()[1][0].f_code.co_filename)
        call_module = inspect.stack()[1][0].f_globals['__name__'].lstrip('Functions.')
        call_line = inspect.stack()[1][0].f_lineno
        self.log.error(
            'App interrupted - file: {}, method: {}, line: {}.'.format(
                call_file, call_module, call_line
            )
        )
        if signal_interupt in (2, 15):
            self.exit(1, 'The App received an interrupt signal and will now exit.')
47741
def handler(self, signum, frame):  # pragma: no cover
        ''''''
        if signum in (signal.SIGTERM, signal.SIGINT, signal.SIGQUIT):
            self.stop(signum)
            os._exit(0)
1125104
public void stop ()
    {
        if (_state == AL10.AL_STOPPED) {
            log.warning("Tried to stop stream that was already stopped.");
            return;
        }
        _source.stop();
        _state = AL10.AL_STOPPED;
    }
1341433
def signal_handler(signal_name, frame):
    """"""
    sys.stdout.flush()
    print("\nSIGINT in frame signal received. Quitting...")
    sys.stdout.flush()
    sys.exit(0)
521814
@Handler(priority = -1000)
    public void onStop(Stop event) {
        if (closing || !serverSocketChannel.isOpen()) {
            return;
        }
        newSyncEventPipeline().fire(new Close(), this);
    }
355760
def stop(self):
        """"""
        self.prestop()
        if not self._graceful:
            self._graceful = True
        self.stream.stop_stream()
        self.audio.terminate()
        msg = 'Stopped'
        self.verbose_info(msg, log=False)
        # Log 'Stopped' anyway
        if self.log:
            self.logging.info(msg)
        if self.collect:
            if self._data:
                print('Collected result:')
                print('    min: %10d' % self._data['min'])
                print('    max: %10d' % self._data['max'])
                print('    avg: %10d' % int(self._data['avg']))
        self.poststop()
983621
def stop_capture_handler(self, name):
        ''' 
        '''
        empty_capturers_indeces = []
        for k, sc in self._stream_capturers.iteritems():
            stream_capturer = sc[0]
            stream_capturer.remove_handler(name)

            if stream_capturer.handler_count == 0:
                self._pool.killone(sc[1])
                empty_capturers_indeces.append(k)

        for i in empty_capturers_indeces:
            del self._stream_capturers[i]
800125
private void notifyMotionListeners(BufferedImage currentOriginal) {
		WebcamMotionEvent wme = new WebcamMotionEvent(this, previousOriginal, currentOriginal, algorithm.getArea(), algorithm.getCog(), algorithm.getPoints());
		for (WebcamMotionListener l : listeners) {
			try {
				l.motionDetected(wme);
			} catch (Exception e) {
				WebcamExceptionHandler.handle(e);
			}
		}
	}
1138090
def set_terminate_listeners(stream):
    """"""

    def stop(signum, frame):
        terminate(stream.listener)

    # Installs signal handlers for handling SIGINT and SIGTERM
    # gracefully.
    signal.signal(signal.SIGINT, stop)
    signal.signal(signal.SIGTERM, stop)