Insert an array of messages in the queue
 ==== Parameters
 * +events+ array of incoming events
770998
def message(events)
      if events.is_a?(Array)
        events.each { |msg|
          if msg.is_a?(Connfu::Message)
            logger.debug("#{self.class} Inserting message in the queue")
            logger.debug msg.to_s
            queue << msg
          else
            logger.info("Invalid message type #{msg.class}")
          end
        }
      end
    end
367991
def add_message_to_queue(self, payload, **attributes):
        

        return self.queue.send_message(MessageBody=json.dumps(payload),
                                       MessageAttributes={k: {"StringValue": v} for k, v in attributes.items()})
533297
function(event, id, msg) {
      var self = this;
      var events = self['_on' + event];

      // Loop through event store and fire all functions.
      for (var i=events.length-1; i>=0; i--) {
        // Only fire the listener if the correct ID is used.
        if (!events[i].id || events[i].id === id || event === 'load') {
          setTimeout(function(fn) {
            fn.call(this, id, msg);
          }.bind(self, events[i].fn), 0);

          // If this event was setup with `once`, remove it.
          if (events[i].once) {
            self.off(event, events[i].fn, events[i].id);
          }
        }
      }

      // Pass the event type into load queue so that it can continue stepping.
      self._loadQueue(event);

      return self;
    }
416552
protected function sendHelpReply(Event $event, Queue $queue, array $messages)
    {
        $method = 'irc' . $event->getCommand();
        $target = $event->getSource();
        foreach ($messages as $message) {
            $queue->$method($target, $message);
        }
    }
1268236
function dispatchQueuedRequests()
  {
    me.requestQueue.forEach(me.worker.send.bind(me.worker));
    me.requestQueue = [];
  }
1091165
def log(messages, event = :debug, level = event)
      messages = Array(messages).map {|m| filter(m, event)}.compact
      each {|l| l.log(messages, event, level)}
    end
1122487
def QueueMessages(self, messages):
    """"""
    # Push all the messages to our input queue
    for message in messages:
      self._in_queue.put(message, block=True)
848852
def add_messages(self, messages):
        
        # remove old messages
        if len(messages) > self.limit:
            messages = messages[:self.limit]
        _logger(self.__class__).log(5, 'adding %s messages' % len(messages))
        self._finished = False
        self._new_messages = messages
        self._to_check = list(self._messages)
        self._pending_msg = messages
        # start removing messages, new message won't be added until we
        # checked all message that need to be removed
        QtCore.QTimer.singleShot(1, self._remove_batch)
5506
def post(self, *messages):
        
        url = "queues/%s/messages" % self.name

        msgs = [{'body': msg} if isinstance(msg, basestring) else msg
                for msg in messages]
        data = json.dumps({'messages': msgs})

        result = self.client.post(url=url, body=data,
                                  headers={'Content-Type': 'application/json'})

        return result['body']
520704
function addData(a)
        {
            if(isObject(a.event.value) || isArray(a.event.value))
            {
                if(!isObservable(a.event.value))
                {
                    a.preventDefault();
                    var local = a.event.local,
                        str = local.__kbscopeString+(local.__kbscopeString.length !== 0 ? '.' : '')+a.key,
                        builder = (isObject(a.event.value) ? KObject : KArray)(local.__kbname,local,str);
                    
                    overwrite(builder).parseData(a.event.value);
                    if(local[a.key] === undefined)
                    {
                      local.add(a.key,builder);
                    }
                    else if(isArray(local))
                    {
                      local.splice(a.key,0,builder);
                    }
                    else if(isObject(local))
                    {
                      local.set(a.key,builder);
                    }
                }
            }
        }
52259
def _init_event_data(params)
      # set state
      @state = {
        reloaded: !params[:evnt].nil?,
        saved: true
      }

      # set options
      initial_options = {
        exceptions: false,
        silent: false
      }
      default_options = _safe_default_options || {}
      params_options = params[:_options] || {}
      @options = initial_options.merge(default_options)
                                .merge(params_options)

      # set name and attributes
      @name = _safe_name
      @attributes = _safe_attributes

      # set payload
      payload = params.reject { |k, _v| k[0] == '_' }
      @payload = @state[:reloaded] ? payload : _generate_payload(payload)

      # set extras
      @extras = {}
      extras = params.select { |k, _v| k[0] == '_' }
      extras.each { |k, v| @extras[k[1..-1].to_sym] = v }
    end
625796
public void sendEventsFromQueue() {
        if (null == queue || stopSending) {
            return;
        }
        LOG.fine("Scheduler called for sending events");

        int packageSize = getEventsPerMessageCall();

        while (!queue.isEmpty()) {
            final List<Event> list = new ArrayList<Event>();
            int i = 0;
            while (i < packageSize && !queue.isEmpty()) {
                Event event = queue.remove();
                if (event != null && !filter(event)) {
                    list.add(event);
                    i++;
                }
            }
            if (list.size() > 0) {
                executor.execute(new Runnable() {
                    public void run() {
                        try {
                            sendEvents(list);
                        } catch (MonitoringException e) {
                            e.logException(Level.SEVERE);
                        }
                    }
                });

            }
        }

    }
343712
def send_events(self, events):
        
        message = riemann_client.riemann_pb2.Msg()
        for event in events:
            message.events.add().MergeFrom(event)
        return self.transport.send(message)
1313228
public void handleIncomingMessage(byte[] data, int offset, int len) {
		synchronized(messageQueue) {
			messageQueue.add(new IncomingMessage(data, offset, len));
		}
		synchronized(lock) {
			lock.notifyAll();
		}
	}
287444
def send(self, message_id, args=[], kwargs={}):
        
        self._logger.debug('Send {} in stm {}'.format(message_id, self.id))
        self._driver._add_event(
            event_id=message_id, args=args, kwargs=kwargs, stm=self)
1326886
public static void pushMessages(String queueURL, List<String> messages) {
		if (!StringUtils.isBlank(queueURL) && messages != null) {
			// only allow strings - ie JSON
			try {
				int	j = 0;
				List<SendMessageBatchRequestEntry> msgs = new ArrayList<>(MAX_MESSAGES);
				for (int i = 0; i < messages.size(); i++) {
					String message = messages.get(i);
					if (!StringUtils.isBlank(message)) {
						msgs.add(new SendMessageBatchRequestEntry().
								withMessageBody(message).
								withId(Integer.toString(i)));
					}
					if (++j >= MAX_MESSAGES || i == messages.size() - 1) {
						if (!msgs.isEmpty()) {
							getClient().sendMessageBatch(queueURL, msgs);
							msgs.clear();
						}
						j = 0;
					}
				}
			} catch (AmazonServiceException ase) {
				logException(ase);
			} catch (AmazonClientException ace) {
				logger.error("Could not reach SQS. {}", ace.toString());
			}
		}
	}
2061
function insertArray (table, object, fields) {
  var input = this

  input.forEach(function addRow (entry, rowNo) {
    var tableRow = fields.map(function cell (fieldName) {
      return getCellContent.call(entry, object.fields[fieldName], rowNo)
    })
    table.push(tableRow)
  })
}