Respond to the PUNSUBSCRIBE command.
187143
function execute(req, res) {
  this.state.pubsub.punsubscribe(req.conn, req.args);
}
1067800
def subscribe(self, topic, channel):
        """"""
        self.send(nsq.subscribe(topic, channel))
1111008
def subscribe(self, subscription):
        """"""
        url = urljoin(self._url, '/subscriptions')
        return subscription.post(url)
1027291
def start_subscribe(self):
        """"""
        if not self.conn:
            raise ValueError('Not connected')
        elif not self.pubsub_conn:
            raise ValueError('PubSub not enabled')

        # creates a new context manager
        return Subscription(self)
1142317
def receive_reply(self, msg, content):
        """"""
        reply_head = content.head()
        if reply_head == 'error':
            comment = content.gets('comment')
            logger.error('Got error reply: "%s"' % comment)
        else:
            extractions = content.gets('ekb')
            self.extractions.append(extractions)
        self.reply_counter -= 1
        if self.reply_counter == 0:
            self.exit(0)
280202
def execute(self, email):
        """"""
        print('Sign up user {0}'.format(email))
        self.email_sender.send(email, 'Welcome, "{}"'.format(email))
1200510
def punsubscribe(self, pattern, *patterns):
        
        conn = self._pool_or_conn
        return conn.execute_pubsub(b'PUNSUBSCRIBE', pattern, *patterns)
1303790
function reply(req, res, timeout) {
  var _timer;

  if(timeout) {
    //console.dir(timeout);
    //console.error(Date.now());
    _timer = setTimeout(this.onTimeout, timeout);
    this._busy = true;
  }

  function onClose(code, signal) {
    //console.dir('close called: ' + signal);
    //console.dir(code);
    //console.dir(signal);
    this.ps.removeAllListeners();
    clearTimeout(_timer);
    this.ps = null;
    this._busy = false;
    this._written = false;
    var msg, err = new StoreError(
      null, 'script execution process exited with code: %s', code || 0);
    if(signal === 'SIGQUIT') {
      msg = 'error running script (call to %s): '
      msg += '@user_script: script killed by user with SCRIPT KILL';
      err = new StoreError(null, msg, this._script || 'user_script');
    }
    res.send(err);
  }

  function onMessage(msg) {
    var cmd, args;

    //console.dir(msg);

    // getting the current script name
    if(msg.event === 'eval') {
      this._script = msg.data;
      return;

    // calling out to execute a command
    }else if(msg.event === 'call') {
      req.cmd = msg.cmd;
      req.args = msg.args;

      //console.dir('got call event');

      var exec = this._commands[req.cmd];
      if(exec && exec.definition && exec.definition.write) {
        this._written = true;
        //console.dir('marking command as writing data...');
      }

      function onCommand(err, reply) {
        // restore req and res
        req.cmd = cmd;
        req.args = args;
        req.script = false;
        delete res.cb;

        var data = err ? err.message : reply;
        if(reply instanceof Buffer) reply = reply.toString();
        this.ps.send(
          {event: msg.event, err: (err instanceof Error), data: data});
      }

      req.script = true;

      res.cb = onCommand.bind(this);
      this.emit('command', req, res);
      //this.ps.once('message', onMessage.bind(this));
      return;
    }

    // ps may be null if script was killed
    if(this.ps) {
      this.ps.removeAllListeners();
    }

    clearTimeout(_timer);

    // sending data back to the client
    this._busy = false;
    this._written = false;
    var data = msg.data;
    if(msg.err) return res.send(new Error(data));
    if(msg.str) data = new String(data);
    return res.send(null, data);
  }

  this.ps.on('message', onMessage.bind(this));
  this.ps.once('close', onClose.bind(this));
}
1279851
def punct(self, text):
        """"""
        cls = self.PUNCTUATION[text]
        self.push_token(cls(text, self.lineno, self.offset))
946531
def start (self):
        '''
        

        '''
        self.sub = rospy.Subscriber(self.topic, BumperEvent, self.__callback)
403759
def reply(self):
        """"""
        status = self.get_selected_status()
        app, user = self.app, self.user
        if not app or not user:
            self.footer.draw_message("You must be logged in to reply", Color.RED)
            return

        compose_modal = ComposeModal(self.stdscr, default_cw='\n'.join(status['spoiler_text']) or None, resize_callback=self.on_resize)
        content, cw = compose_modal.loop()
        self.full_redraw()
        if content is None:
            return
        elif len(content) == 0:
            self.footer.draw_message("Status must contain content", Color.RED)
            return

        self.footer.draw_message("Submitting reply...", Color.YELLOW)
        response = api.post_status(app, user, content, spoiler_text=cw, sensitive=cw is not None, in_reply_to_id=status['id'])
        status = parse_status(response)
        self.statuses.insert(0, status)
        self.selected += 1
        self.left.draw_statuses(self.statuses, self.selected)
        self.footer.draw_message("✓ Reply posted", Color.GREEN)
1167052
public void _onSubscribe(Subscription subscription) {
        producer = subscription;
        ArrayList<Runnable> tmp = this.doOnSubscribe;
        this.doOnSubscribe = null;
        tmp.forEach(runnable -> runnable.run());
    }
840002
def listen_for_updates(self):
        """"""
        self.toredis.subscribe(self.group_pubsub, callback=self.callback)
951937
function (event) {
    this.debug("Requesting subscription for " + event);
    sendReceive.call(this, {'do': 'subscribe', params: [event]}, function (result) {
        if (result.success) {
            this.debug("Succesfully subscribed to %s", event);
        } else {
            this.debug("Subscription request for %s failed", event);
        }
    });
    this.subscribedEvents.push(event);
}
1046054
def subscribe(ws):
    """"""
    while ws is not None:
        gevent.sleep(0.1)
        try:
            message = ws.receive()  # expect function name to subscribe to
            if message:
                stream.register(ws, message)
        except WebSocketError:
            ws = None
426880
def respond(self, output):
        """"""
        response = {'exit_code': output.code,
                    'command_output': output.log}

        self.send_response(200)

        self.send_header('Content-type', 'application/json')
        self.end_headers()

        self.wfile.write(bytes(json.dumps(response), "utf8"))
33057
def subscribe(self, feedUrl):
        
        response = self.httpPost(
            ReaderUrl.SUBSCRIPTION_EDIT_URL,
            {'ac':'subscribe', 's': feedUrl})
        # FIXME - need better return API
        if response and 'OK' in response:
            return True
        else:
            return False