build the appropriate queues to send this response to based on related detection systems
331366
private Collection<String> buildQueueNames(Response response) {
		Collection<String> queueNames = new HashSet<>();
		
		Collection<String> detectionSystemNames = appSensorServer.getConfiguration().getRelatedDetectionSystems(response.getDetectionSystem());
		
		for(String detectionSystemName : detectionSystemNames) {
			queueNames.add(RabbitMqUtils.buildResponseQueueName(detectionSystemName));
		}

		return queueNames;
	}
185185
def _obtain_queue(num_jobs):
    
    if _should_use_multiprocessing(num_jobs):
        return ReprQueue(multiprocessing.Manager().Queue())

    return ReprQueue(Queue())
211887
def _queue_response_channel(self, obj):
        
        return '{}.{}'.format(state.MANAGER_EXECUTOR_CHANNELS.queue_response, obj[ExecutorProtocol.DATA_ID])
1084835
private Collection<String> buildTopicNames(Response response) {
		Collection<String> topicNames = new HashSet<>();
		
		Collection<String> detectionSystemNames = appSensorServer.getConfiguration().getRelatedDetectionSystems(response.getDetectionSystem());
		
		for(String detectionSystemName : detectionSystemNames) {
			topicNames.add(KafkaUtils.buildResponseTopicName(detectionSystemName));
		}

		return topicNames;
	}
1262407
def got_response(self):
        
        return any(message.sender != self.initiator
                   for message in self.messages)
1049371
private void sendQueuedInvocations() {
        while (true) {
            MethodInvocation<?> currentRPC = queuedRpcList.poll();
            if (currentRPC == null) {
                return;
            }

            try {
                connector.executeAsyncMethod(currentRPC.getProxy(),
                                             currentRPC.getMethod(),
                                             currentRPC.getArgs(),
                                             currentRPC.getFuture());
            } catch (JoynrRuntimeException e) {
                currentRPC.getFuture().onFailure(e);
            } catch (Exception e) {
                currentRPC.getFuture().onFailure(new JoynrRuntimeException(e));
            }

        }

    }
868359
function queueOrRequest( el ){
			var url = el.data( "url" );
			if( o.proxy && $.inArray( url, urllist ) === -1 ){
				urllist.push( url );
				elQueue = elQueue.add( el );
			}
			else{
				AI.makeReq( url, el );
			}
		}
317187
def _publish_queue_wss(self):
        

        msg = []
        for m in self._tx_queue:
            msg.append({'id': m.id, 'body': m.body, 'zone_id': m.zone_id})
        self._ws.send(json.dumps(msg), opcode=websocket.ABNF.OPCODE_BINARY)
337263
public void run() {

    ResponseWrapper response = null;

    LOGGER.info("Received probe id: " + probe.getProbeId());

    // Only handle probes that we haven't handled before
    // The Probe Generator needs to send a stream of identical UDP packets
    // to compensate for UDP reliability issues. Therefore, the Responder
    // will likely get more than 1 identical probe. We should ignore
    // duplicates.
    if (!isProbeHandled(probe.getProbeId())) {

      if (this.noBrowser && probe.isNaked()) {
        LOGGER.warn("Responder set to noBrowser mode. Discarding naked probe with id [" + probe.getProbeId() + "]");
      } else {

        for (ProbeHandlerPlugin handler : handlers) {
          response = handler.handleProbeEvent(probe);
          if (!response.isEmpty()) {
            LOGGER.debug("Response to probe [" + probe.getProbeId() + "] includes " + response.numberOfServices());
            Iterator<RespondToURL> respondToURLs = probe.getRespondToURLs().iterator();

            if (probe.getRespondToURLs().isEmpty())
              LOGGER.warn("Processed probe [" + probe.getProbeId() + "] with no respondTo address. That's odd.");

            if (respondToURLs.hasNext()) {
              RespondToURL respondToURL = respondToURLs.next();
              // we are ignoring the label for now
              boolean success = sendResponse(respondToURL.url, probe.getRespondToPayloadType(), response);
              if (!success) {
                LOGGER.warn("Issue sending probe [" + probe.getProbeId() + "] response to [" + respondToURL.url + "]");
              }
            }

          } else {
            LOGGER.error("Response to probe [" + probe.getProbeId() + "] is empty.  Not sending empty response.");
          }
        }

      }

      markProbeAsHandled(probe.getProbeId());

      responder.probeProcessed();

    } else {
      LOGGER.info("Discarding duplicate/handled probe with id: " + probe.getProbeId());
    }
  }
744639
def queue_actions(self, source, actions, event_args=None):
		
		source.event_args = event_args
		ret = self.trigger_actions(source, actions)
		source.event_args = None
		return ret
14692
def build_response(cls, code=Status.SYSTEM_ERROR, errors=None):
        
        errors = [errors] if not isinstance(errors, list) else errors
        return cls(code, errors)
591857
def process_response(self, request, response):
        """"""
        batcher = PrioritizedBatcher.global_instance()
        if batcher.is_started:
            # May not be started due to strange middleware behavior on first request.
            batcher.commit()

        return response
271952
def notify(msg)

      waiters, observers = @services.select { |n, s|
        s.respond_to?(:on_msg)
      }.sort_by { |n, s|
        n
      }.partition { |n, s|
        s.respond_to?(:wait_for)
      }

      (observers + waiters).each { |n, s| s.on_msg(msg) }
    end
875273
def probe(self, params, lazy=True):
        """"""
        if lazy:
            self._queue.add(params)
        else:
            self._space.probe(params)
            self.dispatch(Events.OPTMIZATION_STEP)
101467
protected Collection<Response> findPossibleResponses(DetectionPoint triggeringDetectionPoint) {
		Collection<Response> possibleResponses = new ArrayList<Response>();

		for (DetectionPoint configuredDetectionPoint : appSensorServer.getConfiguration().getDetectionPoints()) {
			if (configuredDetectionPoint.typeAndThresholdMatches(triggeringDetectionPoint)) {
				possibleResponses = configuredDetectionPoint.getResponses();
				break;
			}
		}

		return possibleResponses;
	}
748043
function queue(runner) {
    if (running < tasks) {
      ++running;
      runner(release);
    } else {
      pending.push(runner);
    }
  }
1249342
def build_from_queue(cls, input_queue, replay_size, batch_size):
    
    return cls(
        lambda: input_queue.dequeue_many(batch_size),
        replay_size,
        batch_size=batch_size)