<commit_before>class Queue extends Node implements IConnectable {
  int type = QUEUE;
  int size = 0;
  
  Queue(String name, float x, float y) {
    super(name, colors[QUEUE], x, y);
  }
  
  int getType() {
    return type;
  }
  
  boolean accepts(Node n) {
    return n.getType() == CONSUMER;
  }
  
  boolean canStartConnection() {
    return true;
  }
}
<commit_msg>implements message delivery from queues<commit_after>class Queue extends Node implements IConnectable {
  int type = QUEUE;
  int depth = 0;
  
  Queue(String name, float x, float y) {
    super(name, colors[QUEUE], x, y);
  }
  
  int getType() {
    return type;
  }
  
  boolean accepts(Node n) {
    return n.getType() == CONSUMER;
  }
  
  boolean canStartConnection() {
    return true;
  }
  
  void trasnferArrived(Transfer transfer) {
    depth++;
    for (int i = 0 ; i < incomingCount ; i++) {
        stage.addTransfer(new Transfer(stage, this, incoming[i], transfer.getData()));
    }
  }
  
  void transferDelivered(Transfer transfer) {
    depth--;
  }
  
  void draw() {
    super.draw();
    
    // draw queue depth text
    fill (0);
    textAlign(CENTER, CENTER);
    text(str(depth), x + radii + 5, y - radii - 5);
  }
}

{'fraction_non_alphanumeric': 0.12520593080724876, 'fraction_numerical': 0.004942339373970346, 'mean_word_length': 2.626865671641791, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '993797', 'n_tokens_mistral': 430, 'n_tokens_neox': 418, 'n_words': 114}