This document gives an overview of completion queue architecture and focuses mainly on the interaction between completion queue and the Polling engine layer.
## Completion queue attributes
Completion queue has two attributes
- Completion_type:
- GRPC_CQ_NEXT: grpc_completion_queue_next() can be called (but not grpc_completion_queue_pluck())
- GRPC_CQ_PLUCK: grpc_completion_queue_pluck() can be called (but not grpc_completion_queue_next())
- GRPC_CQ_CALLBACK: The tags in the queue are function pointers to callbacks. Also, neither next() nor pluck() can be called on this
- Polling_type:
- GRPC_CQ_NON_POLLING: Threads calling completion_queue_next/pluck do not do any polling
- GRPC_CQ_DEFAULT_POLLING: Threads calling completion_queue_next/pluck do polling
- GRPC_CQ_NON_LISTENING: Functionally similar to default polling except for a boolean attribute that states that the cq is non-listening. This is used by the grpc-server code to not associate any listening sockets with this completion-queue’s pollset