The "two customers service queue" acts like a queue with a in-built feature to remove the item at the front of the queue (and any other item in the queue). Items stay in the queue, as long as requests for service are active. To achieve that, instead of storing n values (in this case 2), it stores one value and listens if requests for service are active. By behaving like that, it is also a queue from which items can be deleted, I would say.
Application
I created this circuit for twin train unloading stations. I wanted the trains to be unloaded in sequence, not concurrently. Concurrent unloading often led to a cut stream of resources, when the trains left around the same time.
API
Requests are made by sending any positive continuous value to the connection points for customers one and/or two (A1, A2).
The information of who has to be serviced at the moment, can be read from the continuous output of the memory cell (OUT) (value 0 -> customer 1, value 1 -> customer 2).
Demo
The bp uses mod "creative items" https://mods.factorio.com/mod/CreativeItems .
Fuel the trains and set them to automatic.
The demo features twin unloading stations and 4 trains with various sized cargo. The signals, which are sent to the circuit to make requests for service are the cargo counts from the train stations. This way, the trains will continue to request service until they are empty. The entities, controlled by the output, are the belts in front of the splitter (rather than the unloading inserters, to ensure a continuous stream of resources).
Behavior
The two customers are serviced in the sequence in which their requests arrive. The service for the customer at the front of the queue continues until it withdraws its request for service. Then the other customer is serviced, if it has a request active.
Dual truthtable
Detailed description, explanation of dual truthtable
Internals
Internals
The circuit consists of a binary memory cell (1), the logic to request a change in service for each request/customer (2) and a pulser to change the value in the memory cell (3) (masked to value "1" (3a)).