ARES_QUEUE(3)
π ARES_QUEUE β bestie's guide to checking ur c-ares queue π
okay so this is ARES_QUEUE(3), from the Library Functions Manual, and it's literally the "are we there yet" of the c-ares world πβ¨. Two functions, both about knowing whether ur queries are still out there doing their thing. Let's get into it.
β¨ NAME β¨
ares_queue_wait_empty, ares_queue_active_queries β functions for checking the c-ares queue status π
π¦ SYNOPSIS π¦
#include <ares.h>
size_t ares_queue_active_queries(const ares_channel_t *channel);
ares_status_t ares_queue_wait_empty(ares_channel_t *channel,
int timeout_ms);
πΈ DESCRIPTION πΈ
ares_queue_active_queries(3) π
she tells u the total number of active queries that are still pending answers from servers. no cap. and here's the tea: some c-ares requests lowkey spawn multiple queries β like ares_getaddrinfo(3) when it's using AF_UNSPEC β and all of those will be reflected in this number. so don't be shocked if the count is bigger than u expected, it's not a bug, it's just multitasking main character energy. π
the channel parameter must be set to an initialized channel. no half-baked channels here, bestie.
ares_queue_wait_empty(3) π
this one blocks until it gets notified that there are no longer any queries in queue, OR the timeout u gave it has expired. whichever comes first, girl. β³
the channel parameter must be set to an initialized channel (same rule as above, it's giving consistent).
the timeout_ms parameter is the number of milliseconds to wait for the queue to be empty β or -1 for Infinite. yes, infinite. she'll wait forever for u. obsessed. π
π RETURN VALUES π
ares_queue_active_queries(3) returns the active query count. simple. iconic. no drama. β¨
ares_queue_wait_empty(3) can return any of the following values:
ARES_ENOTIMPβ if it wasn't built with threading support π (the library, not u, ur perfect)ARES_ETIMEOUTβ if the requested timeout expired β°ARES_SUCCESSβ when the queue is empty π periodt.
π AVAILABILITY π
this function was first introduced in c-ares version 1.27.0, and it requires the c-ares library to be built with threading support. so if ur build is threadless, this whole page is giving window shopping ποΈπ
π SEE ALSO π
that's the whole page bestie, go forth and check ur queues responsibly π«Ά
with love, ur fave β ARES_QUEUE(3), 16 February 2024, from the Library Functions Manual π
β¨
π¦ where this page comes from
- alpine 3.22: c-ares-doc 1.34.9-r0 Β· MIT
- alpine 3.23: c-ares-doc 1.34.9-r0 Β· MIT
- alpine 3.24: c-ares-doc 1.34.9-r0 Β· MIT
- arch rolling: c-ares 1.34.9-1 Β· MIT
- centos-stream 10: c-ares-devel 1.34.9-1.el10 Β· MIT
- debian trixie: libc-ares-dev 1.34.5-1+deb13u1 Β· MIT
- fedora 43: c-ares-devel 1.34.5-2.fc43 Β· MIT
- fedora 43: c-ares-devel 1.34.5-2.fc43 Β· MIT
- fedora 43: c-ares-devel 1.34.8-1.fc43 Β· MIT
- fedora 43: c-ares-devel 1.34.8-1.fc43 Β· MIT
- fedora 44: c-ares-devel 1.34.6-3.fc44 Β· MIT
- fedora 44: c-ares-devel 1.34.6-3.fc44 Β· MIT
- fedora 44: c-ares-devel 1.34.8-1.fc44 Β· MIT
- fedora 44: c-ares-devel 1.34.8-1.fc44 Β· MIT
- nixos 26.05: c-ares 1.34.9
- nixpkgs unstable: c-ares 1.34.8
- opensuse-leap 16.0: c-ares-devel 1.34.8-160000.1.1 Β· MIT
- opensuse-leap 16.0: c-ares-devel 1.34.8-160000.1.1 Β· MIT
- opensuse-leap 16.0: c-ares-devel 1.34.8-160000.1.1 Β· MIT
- opensuse-leap 16.0: c-ares-devel 1.34.8-160000.1.1 Β· MIT
- ubuntu questing: libc-ares-dev 1.34.5-1
- ubuntu questing: libc-ares-dev 1.34.5-1ubuntu0.1
- ubuntu resolute: libc-ares-dev 1.34.6-1 Β· MIT
- ubuntu resolute: libc-ares-dev 1.34.6-1ubuntu0.1
- ubuntu resolute: libc-ares-dev 1.34.6-1ubuntu0.2 Β· MIT
- ubuntu stonking: libc-ares-dev 1.34.8-1 Β· MIT
- π the page's license: MIT
- Copyright (C) 2024 The c-ares project and its contributors
- Copyright 2024 by the c-ares project and its contributors
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms