# Timeout e preemption no bloco Queue

Dois recursos comuns nos softwares de simulação são a possibilidade de desistência do agente em fila (**timeout**) e a saída do agente da fila por alguma regra específica de preferência (**preemption**). O bloco **Queue** possui as duas portas de saída já prontas para o usuário identificar qual cliente saiu por qual motivo:

![](https://lh4.googleusercontent.com/5czJfDlQ00i-7AP-KrIx2_Lb4rMRetJ-vfJLJJ_hvORkyIa0hksPb-bxsXXhqUK0-K5sc-Ym_vcgIZMo_KauVogIKvYGUiY1pTIwxPVdivcxr1kR5IVNQyzRO_3oS0AWCoiFHAQZ)

A primeira porta, que equivale à saída por **preemption**, significa que o agente encontrou a fila cheia e, pela regra de preferência, foi extirpado da fila. Note que, para esta opção funcionar, além da opção **Enable preemption** estar ligada, a capacidade da fila deve ser finita.&#x20;

Por exemplo, considere o caixa eletrônico da agência bancária com capacidade de fila de 5 agentes. Se um sexto cliente chegar com interesse em utilizar o caixa eletrônico, ele deveria desistir e ir embora do sistema. O fluxo de processos é relativamente simples neste caso:

![](https://lh3.googleusercontent.com/-iQytu6IBcQwfSxvGLeiUB8o9HH2bSXT22FeOai7YOTlsFqKtviXhUexjK9tlJFAbv5IkMc_brXMqHFVDGs7ypkbBRKOx0MUQq81wOfS72REdp_7Yw7rUD8cG1uX4P_3bdZPxVy_)

Atenção às propriedades do bloco **queue**:

![](https://lh6.googleusercontent.com/iWfDbBRG6xLpt-eBH1BiQgkvRoELQyOMHZeQQojmkinC-H4FKRPPDHHxLki_BL_44SzMuz5eh_ferqB1KSDA8FEEebwRx1YzDobUDc2fS3HUVm86sXT2pt9hZ25rXYtabZHVgXMR)

A segunda porta do bloco **Queue** serve para saída dos agentes que ultrapassaram o tempo máximo de espera especificado. Considere, por exemplo, que na agência bancária, se o cliente aguardar mais do que 15 minutos ele desiste e vai embora. Novamente, o fluxo de processos é bem simples:

![](https://lh3.googleusercontent.com/ZHPmH2FtVU_XmwWlpE4ewLHLZb24eWnGcAVG9O6BDP-wfHz5cozfrJpgkkUD8mmpElDrxXT_8l9Ac4uT3bYTFBEqU07BBoHFl9xFdR_zQNT1Wp8qw04-DMsx-Q-1VL9-tbgjOTdY)

E os parâmetros do bloco **queue** são intuitivos, também:

![](https://lh3.googleusercontent.com/0KDfROIvGPlhi_KvDJ0JaEmiLna1reaoUwhYm2X6trfOTKlFYYrMZ4-cupRbALDvMmxyiotHH7U8k9mQu6DjaB5zrHjprzhuxNKCTE6coCEgz-MHZtqPXBHrTtOD8u2pU5McVpak)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://tutorial.anylogicbrasil.com.br/timeout-e-preemption-no-bloco-queue.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
