Override of {Interfaces::Client#listen}
 @yieldparam [String] text
481700
def listen
      perform_with_bot do |bot|
        bot.listen do |message|
          next if message.nil?
          text = message.text
          next if text.nil?
          yield text
        end
      end
    end
322642
function _listen() {

            var controllers     = $ember.get(this, 'controllers'),
                getController   = Ember.run.bind(this, this._getController),
                events          = [],
                module          = this,
                respond         = function respond() {
                    var eventData = Array.prototype.slice.call(arguments);
                    module._update.call(module, this, eventData);
                };

            controllers.forEach(function controllerIteration(controllerName) {

                // Fetch the controller if it's valid.
                var controller  = getController(controllerName),
                    eventNames  = controller[this.NAMESPACE];

                if (controller) {

                    // Invoke the `connect` method if it has been defined on this controller.
                    if (typeof controller[this.NAMESPACE] === 'object' && typeof controller[this.NAMESPACE].connect === 'function') {
                        controller[this.NAMESPACE].connect.apply(controller);
                    }

                    // Iterate over each event defined in the controller's `sockets` hash, so that we can
                    // keep an eye open for them.
                    for (var eventName in eventNames) {

                        if (eventNames.hasOwnProperty(eventName)) {

                            if (events.indexOf(eventName) !== -1) {
                                // Don't observe this event if we're already observing it.
                                continue;
                            }

                            // Push the event so we don't listen for it twice.
                            events.push(eventName);

                            // Check to ensure the event was not previously registered due to a reconnect
                            if (!(eventName in $ember.get(module, 'socket')._callbacks)) {

                                // ...And finally we can register the event to listen for it.
                                $ember.get(module, 'socket').on(eventName, respond.bind(eventName));

                            }

                        }

                    }

                }

            }, this);

        }
805197
def receive(timeout = nil, &block)
      message = nil
      Timers::Wait.for(timeout) do |_remaining|
        message = check(timeout, &block)
        break if message
      end
      return message if message
      raise TaskTimeout, "receive timeout exceeded"
    end
614209
async def eval(self, text, opts=None, user=None):
        '''
        
        '''
        if user is None:
            user = self.user

        # maintained for backward compatibility
        query = self.core.getStormQuery(text)
        with self.getStormRuntime(opts=opts, user=user) as runt:
            async for node, path in runt.iterStormQuery(query):
                yield node
16687
def render(*args, &block)
      if $_compiler_stack && $_compiler_stack.last
        $_compiler_stack.last.render(*args, &block)
      else
        Origen.generator.compiler.render(*args, &block)
      end
    end
1202346
def subscribe(caller = nil, &block)
      if block_given?
        notify_when = block.call(state)
        @listeners << { obj: block.binding.receiver, notify_when: notify_when }
      else
        @listeners << { obj: caller }
      end
    end
654832
def listen(hosts, port)
      hosts.each do |host|
        @server.listen(host, port)
      end
      true
    rescue Errno::EADDRINUSE
      ChefZero::Log.warn("Port #{port} not available")
      @server.listeners.each { |l| l.close }
      @server.listeners.clear
      false
    end
810247
function bindFromStrings(target, entity, evt, methods){
    var methodNames = methods.split(/\s+/);

    _.each(methodNames,function(methodName) {

      var method = target[methodName];
      if(!method) {
        throwError("Method '"+ methodName +"' was configured as an event handler, but does not exist.");
      }

      target.listenTo(entity, evt, method, target);
    });
  }
738238
def each(&blk)
      fields.each do |field|
        if field.child?
          val = self.send(field.reader)
          yield val unless val.nil?
        end
      end
      return self
    end
1060062
def intercept!(type, args = {})
      return yield if @interceptors.none?

      i = @interceptors.pop
      return yield unless i

      i.send(type, args) do
        if @interceptors.any?
          intercept!(type, args) do
            yield
          end
        else
          yield
        end
      end
    end
576223
function () {
            /*  determine parameters  */
            var params = $cs.params("listen", arguments, {
                name:    { pos: 0,     req: true },
                ctx:     {             def: this },
                func:    { pos: 1,     req: true },
                args:    { pos: "...", def: []   },
                spec:    {             def: null } /* customized matching */
            });

            /*  attach listener information  */
            var id = _cs.cid();
            this.__listener[id] = params;
            return id;
        }
876320
function listen(name, callback) {
    if (!showdown.helper.isString(name)) {
      throw Error('Invalid argument in converter.listen() method: name must be a string, but ' + typeof name + ' given');
    }

    if (typeof callback !== 'function') {
      throw Error('Invalid argument in converter.listen() method: callback must be a function, but ' + typeof callback + ' given');
    }

    if (!listeners.hasOwnProperty(name)) {
      listeners[name] = [];
    }
    listeners[name].push(callback);
  }
329012
def handle_generic(tokens, options)
      t = Chronic.time_class.parse(options[:text])
      Span.new(t, t + 1)
    rescue ArgumentError => e
      raise e unless e.message =~ /out of range/
    end
221888
function (name, params) {
        assert(isString(name), 'EventEmitter#emit: name is not a string');

        forEach(this._listeners, function (event) {
            if (event.name === name) {
                event.fn.call(event.ctx, params);
            }

            // Special behaviour for wildcard - invoke each event handler.
            var isWildcard = (/^all|\*$/).test(event.name);

            if (isWildcard) {
                event.fn.call(event.ctx, name, params);
            }
        });

        return this;
    }
326316
async def eval(self, text, opts=None):
        '''
        
        '''
        async for pode in self.cell.iterStormPodes(text, opts=opts, user=self.user):
            yield pode
44096
def invoke
      res = catch(:halt) { yield }

      res = [res] if Integer === res or String === res
      if Array === res and Integer === res.first
        res = res.dup
        status(res.shift)
        body(res.pop)
        headers(*res)
      elsif res.respond_to? :each
        body res
      end
      nil # avoid double setting the same response tuple twice
    end
244325
function(params, options) {
      var t = this;

      // If raw text was sent to the template, compile and return
      if (t.get('text')) {
        t.compile();
        return;
      }

      // Watch for changes in the text element
      t.on('change:text', t.compile, t);

      // Process a file template
      var path = t.get('path');
      if (path) {
        // Load the file
        if (t.asyncLoad) {
          FS.readFile(path, function(err, text) {
            if (err) {
              return console.error('Error reading file: ' + path, err);
            }
            t.set({text: text.toString()});
          });
        } else {
          t.set({text: FS.readFileSync(path).toString()});
        }

        // Watch the file for changes
        if (t.get('watchFile')) {
          t._watchFile();
        }
      }
    }