Renders detailed service information about one listener
14733
protected function outputListener(OutputInterface $output, $serviceId)
    {
        $fetcher = new ListenerFetcher($this->getContainerBuilder());
        $definition = $fetcher->fetchListener($serviceId);

        $label = sprintf('Information for listener <info>%s</info>', $serviceId);
        $output->writeln($this->getHelper('formatter')->formatSection('container', $label));
        $output->writeln('');

        if ($definition instanceof Alias) {
            $output->writeln(sprintf('This service is an alias for the service <info>%s</info>', (string) $definition));

            return;
        }

        $output->writeln(sprintf('<comment>Listener Id</comment>   %s', $serviceId));
        $output->writeln(sprintf('<comment>Class</comment>         %s', $definition->getClass()));

        $type = ($fetcher->isSubscriber($definition)) ? 'subscriber' : 'listener';
        $output->writeln(sprintf('<comment>Type</comment>         %s', $type));
        $output->writeln(sprintf('<comment>Listens to</comment>', ''));
        $events = array();

        $tags = $definition->getTags();
        foreach ($tags as $tag => $details) {
            if (preg_match(ListenerFetcher::SUBSCRIBER_PATTERN, $tag)) {
                $subscribed = $fetcher->getEventSubscriberInformation($definition->getClass());
                foreach ($subscribed as $name => $current) {
                    //Exception when event only has the method name
                    if (!is_array($current)) {
                        $current = array($current);
                    } elseif (is_array($current[0])) {
                        $current = $current[0];
                    }

                    $event['name'] = $name;
                    $event['method'] = $current[0];
                    $event['priority'] = (isset($current[1])) ? $current[1] : 0;
                    $events[] = $event;
                }
            } elseif (preg_match(ListenerFetcher::LISTENER_PATTERN, $tag)) {
                foreach ($details as $current) {
                    $event['name'] = $current['event'];
                    $event['method'] = (isset($current['method'])) ? $current['method'] : $current['event'];
                    $event['priority'] = isset($current['priority']) ? $current['priority'] : 0;
                    $events[] = $event;
                }
            }
        }

        foreach ($events as $event) {
            $output->writeln(sprintf('<comment>  -Event</comment>         %s', $event['name']));
            $output->writeln(sprintf('<comment>  -Method</comment>        %s', $event['method']));
            $output->writeln(sprintf('<comment>  -Priority</comment>      %s', $event['priority']));
            $output->writeln(sprintf('<comment>  -----------------------------------------</comment>'));
        }

        $tags = $tags ? implode(', ', array_keys($tags)) : '-';
        $output->writeln(sprintf('<comment>Tags</comment>         %s', $tags));
        $public = $definition->isPublic() ? 'yes' : 'no';
        $output->writeln(sprintf('<comment>Public</comment>       %s', $public));
    }
213961
def configure(self, listener):
        
        listener.capture([{re.compile('^_.+'): {'source': {'space': self._event_space, 'id': self._source_id}}}])
41661
private void deliverMediaDetailsUpdate(final MediaDetails details) {
        for (MediaDetailsListener listener : getMediaDetailsListeners()) {
            try {
                listener.detailsAvailable(details);
            } catch (Throwable t) {
                logger.warn("Problem delivering media details response to listener", t);
            }
        }
    }
1033179
def listener(self):
        """"""
        while 1:
            try:
                data = self.read_eager()
            except EOFError:
                print('*** Connection closed by remote host ***')
                return
            if data:
                self.stdout.write(data)
            else:
                self.stdout.flush()
1193071
def get_service_details(self, service_id):
		""""""
		content = self._fetch("/service/%s/details" % service_id)
		return FastlyService(self, content)
208731
def handleNotification(self, req):
        """"""
        name = req["method"]
        params = req["params"]
        try: #to get a callable obj 
            obj = getMethodByName(self.service, name)
            rslt = obj(*params)
        except:
            pass
1366701
def _set_listener(instance, obs):
    """"""
    if obs.names is everything:
        names = list(instance._props)
    else:
        names = obs.names
    for name in names:
        if name not in instance._listeners:
            instance._listeners[name] = {typ: [] for typ in LISTENER_TYPES}
        instance._listeners[name][obs.mode] += [obs]
683974
def mapListener(self, to, From, protocolName, protocolFactory,
        isClient=False):
        
        listenerID = self._nextConnectionID(From, to)
        call = reactor.callLater(120,
                                 self.unmapListener,
                                 listenerID)
        expires = datetime.datetime(*time.localtime(call.getTime())[:7])
        self.inboundConnections[listenerID] = (
            _ConnectionWaiter(
                From, to, protocolName, protocolFactory, isClient
            ),
            call
        )
        return expires, listenerID
1088464
function onEvent(e) {
    const eventData = e.detail;

    if (ignoreFiredEvents === true) {
      return;
    }

    fireEvent(e.currentTarget, eventData);
  }
329031
void notifyListener() {
        Node<K, V> node;
        while ((node = pendingNotifications.poll()) != null) {
            listener.onEviction(node.key, node.getValue());
        }
    }
517765
function (name, data, options) {
            var _listeners = this.__handlers__[name],
                _listener,
                _result = null;
            if (_listeners) {
                for (var i = 0, length = _listeners.length; i < length; i++) {
                    _listener = _listeners[i];
                    if (_listener && _listener.handler) {
                        if(options && options.method=='apply'){
                            _result = _listener.handler.apply(_listener.context || _listener.owner, data);
                        } else {
                            _result = _listener.handler.call(_listener.context || _listener.owner, _listener.owner, data, options);
                        }
                        if (false === _result) {
                            return false;
                        }
                    }
                }
            }

            return this;
        }
954764
def list_all(dev: Device):
    """"""
    for name, service in dev.services.items():
        click.echo(click.style("\nService %s" % name, bold=True))
        for method in service.methods:
            click.echo("  %s" % method.name)
1333500
private void registerListeners() {
    protocol.registerAppendHandler(this::append);
    protocol.registerBackupHandler(this::backup);
    protocol.registerConsumeHandler(this::consume);
    protocol.registerResetConsumer(this::reset, threadContext);
  }
725834
function(obj, name, callback, context, listening) {
    obj._events = eventsApi(onApi, obj._events || {}, name, callback, {
      context: context,
      ctx: obj,
      listening: listening
    });

    if (listening) {
      var listeners = obj._listeners || (obj._listeners = {});
      listeners[listening.id] = listening;
    }

    return obj;
  }
1358810
function subscribeRaw(peripheralId, serviceUuid, uuid, state, callback) {

  //todo catch exceptions
  var peripheral = peripherals[peripheralId];
  var characteristic = servicesCache[peripheralId].services[serviceUuid].characteristics[uuid];
  var handle = characteristic.descriptors['2902'];

  if (state == false) {
    value = '0000';
  } else {
    if (characteristic.properties == 'indicate'){
      value = '0200';
    } else  {// notify
      value = '0100';
    }    
  }

  //if not connected, connect
  checkConnected(peripheral, function(){
    peripheral.writeHandle(handle, new Buffer(value, 'hex'), false, function(error){
      if (error){
        debug('Subscribe error '.red + peripheralId + ' : ' + serviceUuid + ' : ' + uuid )
      }
      sendEvent({
        type: 'notify',
        peripheralId: peripheralId,
        serviceUuid: serviceUuid,
        characteristicUuid: uuid,
        state: state
      });
    });
  })

  checkRawNotificationListeners();
}
755802
private void loadListeners(ServiceLoader<LifecycleListener> loader) {
        Iterator<LifecycleListener> iterator = loader.iterator();
        while (hasNextSafely(iterator)) {
            try {
                LifecycleListener listener = iterator.next();
                listeners.add(listener);
                LOGGER.info(String.format("Found %s: %s", LifecycleListener.class, listener.getClass()));
            } catch (ServiceConfigurationError e) {
                LOGGER.error("iterator.next() failed", e);
            }
        }
    }
1260764
def list_listeners(self, retrieve_all=True, **_params):
        """"""
        return self.list('listeners', self.lbaas_listeners_path,
                         retrieve_all, **_params)