Pause normal and pubsub clients.
549245
function pause(timeout) {
  var log = this._logger;
  // keep list of matching clients
  var clients = [];
  this._conn.forEach(function(conn) {
    if(!conn.client.isSlave()) {
      clients.push(conn);
      conn.pause();
    }
  })
  function resume() {
    log.notice('resume %s connections', clients.length);
    clients.forEach(function(conn) {
      conn.resume();
    })
  }
  log.notice('pause %s connections for %sms', clients.length, timeout);
  setTimeout(resume, timeout);
}
80298
public Subscription pause( Subscription subscription ) {
    ParameterMap<String, String> params = new ParameterMap<String, String>();
    params.add( "pause", String.valueOf( true ) );
    return RestfulUtils.update( SubscriptionService.PATH, subscription, params, false, Subscription.class, super.httpClient );
  }
1350568
def set_mute(self, enable):
        """"""
        data = '1' if enable else '0'
        params = ('<InstanceID>0</InstanceID><Channel>Master</Channel>'
                  '<DesiredMute>{}</DesiredMute>').format(data)
        self.soap_request(URL_CONTROL_DMR, URN_RENDERING_CONTROL,
                          'SetMute', params)
680603
def pause(self):
		
		if self.decoder.status == mediadecoder.PAUSED:
			self.decoder.pause()
			self.paused = False
		elif self.decoder.status == mediadecoder.PLAYING:
			self.decoder.pause()
			self.paused = True
		else:
			print("Player not in pausable state")
367071
private PauseResult<PersistableUpload> pause(
            final boolean forceCancelTransfers) throws AmazonClientException {
        UploadMonitor uploadMonitor = (UploadMonitor) monitor;
        return uploadMonitor.pause(forceCancelTransfers);
    }
1287020
def pause(self, payload):
        """"""
        # Pause specific processes, if `keys` is given in the payload
        if payload.get('keys'):
            succeeded = []
            failed = []
            for key in payload.get('keys'):
                success = self.process_handler.pause_process(key)
                if success:
                    succeeded.append(str(key))
                else:
                    failed.append(str(key))

            message = ''
            if len(succeeded) > 0:
                message += 'Paused processes: {}.'.format(', '.join(succeeded))
                status = 'success'
            if len(failed) > 0:
                message += '\nNo running process for keys: {}'.format(', '.join(failed))
                status = 'error'

            answer = {'message': message.strip(), 'status': status}

        # Pause all processes and the daemon
        else:
            if payload.get('wait'):
                self.paused = True
                answer = {'message': 'Pausing daemon, but waiting for processes to finish.',
                          'status': 'success'}
            else:
                self.process_handler.pause_all()
                if not self.paused:
                    self.paused = True
                    answer = {'message': 'Daemon and all processes paused.',
                              'status': 'success'}
                else:
                    answer = {'message': 'Daemon already paused, pausing all processes anyway.',
                              'status': 'success'}

        return answer
1247756
async def stop(self):
        """"""
        await self._command_task.future_command(['_set_mode', 0, 0])  # Disable advertising
        await self._cleanup_old_connections()

        self._command_task.stop()
        self._stream.stop()
        self._serial_port.close()

        await super(BLED112Server, self).stop()
146780
def stop(self):
        
        log.info("%r: Stopping %r clients", self.container_id, len(self.clients))
        self.stopped = True
        self._close_clients()
448700
def resume(self) -> None:
        """"""
        with self.__state_lock:
            if self.__state == DataChannelBuffer.State.paused:
                self.__state = DataChannelBuffer.State.started
1186845
def pause(self, id, when=None): # pylint: disable=invalid-name,redefined-builtin
        
        return self.service.post(self.base+str(id)+'/pause/', params={'when': when})
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()
932458
def pause() -> None:
    
    if _logger is not None:
        _log(INFO, "Process", local.name, "pause")
    Process.current().rsim()._gr.switch()
1032925
public void pause ()
    {
        if (_state != AL10.AL_PLAYING) {
            log.warning("Tried to pause stream that wasn't playing.");
            return;
        }
        _source.pause();
        _state = AL10.AL_PAUSED;
    }
1348402
def _process_pubsub(self, obj, *, process_waiters=True):
        """"""
        kind, *args, data = obj
        if kind in (b'subscribe', b'unsubscribe'):
            chan, = args
            if process_waiters and self._in_pubsub and self._waiters:
                self._process_data(obj)
            if kind == b'unsubscribe':
                ch = self._pubsub_channels.pop(chan, None)
                if ch:
                    ch.close()
            self._in_pubsub = data
        elif kind in (b'psubscribe', b'punsubscribe'):
            chan, = args
            if process_waiters and self._in_pubsub and self._waiters:
                self._process_data(obj)
            if kind == b'punsubscribe':
                ch = self._pubsub_patterns.pop(chan, None)
                if ch:
                    ch.close()
            self._in_pubsub = data
        elif kind == b'message':
            chan, = args
            self._pubsub_channels[chan].put_nowait(data)
        elif kind == b'pmessage':
            pattern, chan = args
            self._pubsub_patterns[pattern].put_nowait((chan, data))
        elif kind == b'pong':
            if process_waiters and self._in_pubsub and self._waiters:
                self._process_data(data or b'PONG')
        else:
            logger.warning("Unknown pubsub message received %r", obj)
55284
def pause_process(self, key):
        """"""
        if key in self.processes and key not in self.paused:
            os.killpg(os.getpgid(self.processes[key].pid), signal.SIGSTOP)
            self.queue[key]['status'] = 'paused'
            self.paused.append(key)
            return True
        return False
1072337
def pause(self):
        """"""
        self._response['shouldEndSession'] = True
        self._response['action']['audio']['interface'] = 'pause'
        self._response['action']['audio']['sources'] = []
        return self
721718
def handle_pause(self):
        """"""
        flag = self.reader.byte()
        if flag > 0:
            logger.info(" -> pause: on")
            self.controller.playing = False
        else:
            logger.info(" -> pause: off")
            self.controller.playing = True