Calls senders callbacks
965320
def call_senders(self, routing, clients_list, *args, **kwargs):
        
        for func, routings, routings_re in self.senders:
            call_callback = False

            # Message is published globally
            if routing is None or (routings is None and routings_re is None):
                call_callback = True

            # Message is not published globally
            else:

                # Message is catched by a string routing key
                if routings and routing in routings:
                    call_callback = True

                # Message is catched by a regex routing key
                if routings_re and any(r.match(routing) for r in routings_re):
                    call_callback = True

            if call_callback:
                func(routing, clients_list, *args, **kwargs)
355164
def method_call(receiver, message, args, pseudo_type=None):
    ''''''

    if not isinstance(receiver, Node):
        receiver = local(receiver)
    return Node('method_call', receiver=receiver, message=message, args=args, pseudo_type=pseudo_type)
1191130
function sayHello(call, callback) {
  var reply = new messages.HelloReply();
  reply.setMessage('Hello ' + call.request.getName());
  callback(null, reply);
}
130312
function callListeners(listeners) {
        var current_event_idx = -1;

        // Make sure we have some data to pass to the listeners
        event_data = event_data || undefined;

        // If no bound listeners for this event, leave now
        if (listeners.length === 0) {
            emitComplete();
            return;
        }


        // Call the next listener in our array
        function nextListener() {
            var listener, event_obj;

            // We want the next listener
            current_event_idx++;

            // If we've ran out of listeners end this emit call
            if (!listeners[current_event_idx]) {
                emitComplete();
                return;
            }

            // Object the listener ammends to tell us what it's going to do
            event_obj = {
                // If changed to true, expect this listener is going to callback
                wait: false,

                // If wait is true, this callback must be called to continue running listeners
                callback: function () {
                    // Invalidate this callback incase a listener decides to call it again
                    event_obj.callback = undefined;

                    nextListener.apply(that);
                },

                // Prevents the default 'done' functions from executing
                preventDefault: function () {
                    prevented = true;
                }
            };


            listener = listeners[current_event_idx];
            listener[1].call(listener[2] || that, event_obj, event_data);

            // If the listener hasn't signalled it's going to wait, proceed to next listener
            if (!event_obj.wait) {
                // Invalidate the callback just incase a listener decides to call it anyway
                event_obj.callback = undefined;

                nextListener();
            }
        }

        nextListener();
    }
1296331
function callWaitAllCallbacks() {
    for (var i = 0; i < waitAllCallbacks.length; i++) {
        waitAllCallbacks[0]();
    }
    waitAllCallbacks.splice(0, waitAllCallbacks.splice.length);
    clearInterval(intervalId);
    intervalId = null;
}
1187611
def _send(self, method, **parameters):
        """"""
        msg = {
            'index': self._calls,
            'method': method,
        }
        msg.update(parameters)

        promise = SimplePromise()
        self._callbacks[self._calls] = promise

        self._calls += 1
        self._comm.send(msg)

        return promise
1046243
async def send(self, sender, **kwargs):
        '''  '''
        if not self.receivers:
            return []
        responses = []
        futures = []
        for receiver in self._get_receivers(sender):
            method = receiver()
            if callable(method):
                futures.append(method(sender=sender, **kwargs))
        if len(futures) > 0:
            responses = await asyncio.gather(*futures)
        return responses
805271
def emit(type, sender=nil, *args)
      listeners[type].each { |l| l.fire(sender, *args) } if listeners.has_key? type
    end
667256
def __call(self):
        
        try:
            if self.__callback is not None:
                self.__callback(self.__successes, self.__errors)
        except Exception as ex:
            self.__logger.exception("Error calling back count down "
                                    "handler: %s", ex)
        else:
            self.__called = True
995139
def filter_callbacks(cls, client, event_data):
        """"""

        for event in cls.filter_events(client, event_data):
            for cb in event.callbacks:
                yield cb
395737
def run_callbacks_for(name, args, reverse)
      callbacks_for(name, reverse).map do |block|
        run_callback(block, args)
      end
    end
437480
function sendMessage(client, to, message, callback) {
	resolveID(client, to, function(channelID) {
		client._req('post', Endpoints.MESSAGES(channelID), message, function(err, res) {
			handleResCB("Unable to send messages", err, res, callback);
		});
	});
}
1201718
function callHandler(fn, req, res, next) {
    let context = new Context(req, res);
    if (utils.isGeneratorFunction(fn)) {
        co(fn).call(context, function (err) {
            if (err || !res.terminated) {
                next(err);
            }
        });
    } else {
        fn.call(context);
        if (!res.terminated) {
            next();
        }
    }
}
254823
function callbacks(input, checked, callback, keep) {
    if (!keep) {
      if (checked) {
        input[_callback]('ifToggled');
      };

      input[_callback]('ifChanged')[_callback]('if' + capitalize(callback));
    };
  }
720583
function CallResponse(flags, code, tracing, headers, csum, args) {
    this.type = CallResponse.TypeCode;
    this.flags = flags || 0;
    this.code = code || CallResponse.Codes.OK;
    this.tracing = tracing || Tracing.emptyTracing;
    this.headers = headers || {};
    this.csum = Checksum.objOrType(csum);
    this.args = args || [];
    this.cont = null;
}
542477
def run_callbacks(callback_name, action=nil)
      callbacks = self.class.send(:"#{callback_name}_callbacks")

      callbacks ||= []
      if action
        callbacks = filter_actions_by_only_exclude(callbacks || [], action)
      end

      begin
        callbacks.map { |v| v[0] }.each do |callback|
          case callback
          when Symbol
            send(callback)
          when Proc
            instance_eval(&callback)
          end
        end

        return false
      rescue StopChainException => e
        return true
      end
    end
1175506
def call(self, method, params, callback=None):
        """"""
        cur_id = self._next_id()
        if callback:
            self._callbacks[cur_id] = callback
        self.send({'msg': 'method', 'id': cur_id, 'method': method, 'params': params})