QB_LOOP_TIMER_ADD(3)
β¨ NAME β¨
qb_loop_timer_add β add a timer to the mainloop. that's it, that's the whole vibe π
(this one lives in the libqb Programmer's Manual, just so u know which family reunion we're at π)
πΈ SYNOPSIS πΈ
#include <qb/qbloop.h>
int32_t qb_loop_timer_add(
qb_loop_t *l, /* pointer to the loop instance */
enum qb_loop_priority p, /* the priority */
uint64_t nsec_duration, /* nano-secs in the future to run the dispatch. */
void *data, /* user data passed into the dispatch function */
qb_loop_timer_dispatch_fn dispatch_fn, /* callback function */
qb_loop_timer_handle *timer_handle_out /* handle to delete the timer if needed. */
);
π«Ά PARAMS π«Ά
okay so six things, bestie. six. count em π
lβ pointer to the loop instance. like, the actual mainloop u want this timer to live in πpβ the priority. yes it matters, we'll get to it βnsec_durationβ nano-secs in the future to run the dispatch. nanoseconds!! in the future!! so specific β¨dataβ user data passed into the dispatch function. ur lil payload, ur emotional support pointer πdispatch_fnβ callback function. the thing that actually runs when the timer goes off π₯timer_handle_outβ handle to delete the timer if needed. ur receipt. keep it π§Ύ
π DESCRIPTION π
so this section is, and i'm being so fr right now, empty in the original page. nothing. blank. a whole heading and then vibes π«
not me leaving it here anyway because we keep every section in the same order, periodt. it's giving minimalist. it's giving "the author was busy". iconic either way π
π¦ STRUCTURES π¦
here's the priority enum, and yes u pick one of these three when u call the function π
enum qb_loop_priority {
QB_LOOP_LOW;
QB_LOOP_MED;
QB_LOOP_HIGH;
};
QB_LOOP_LOWβ lowkey priority π’QB_LOOP_MEDβ the middle one, medium energy πQB_LOOP_HIGHβ highkey priority, main character energy π
π RETURN VALUE π
status (0 == ok, -errno == failure)
so: 0 and we're slaying β¨, negative errno and it's giving tragedy π
π NOTE π
it is a one-shot job.
read that again bestie. it fires once. one and done. no encore, no round two, no "run it back". if u want it again u gotta add it again fr fr π―
π₯ SEE ALSO π₯
the whole friend group, go say hi π
qb_loop_job_del(3)qb_loop_run(3)qb_loop_create(3)qb_loop_stop(3)qb_loop_poll_low_fds_event_set(3)qb_loop_signal_del(3)qb_loop_signal_add(3)qb_loop_job_add(3)qb_loop_poll_del(3)qb_loop_destroy(3)qb_loop_timer_expire_time_remaining(3)qb_loop_poll_mod(3)qb_loop_signal_mod(3)qb_loop_timer_del(3)qb_loop_timer_is_running(3)qb_loop_timer_expire_time_get(3)qb_loop_poll_add(3)
π COPYRIGHT π
Copyright (C) 2010-2020 Red Hat, Inc.
okay that's the whole page, u ate it, i'm obsessed π«Ά this was LIBQB, dated 2025-09-16, and it was QB_LOOP_TIMER_ADD(3) the entire time π bye bestie, go schedule something β¨
π¦ where this page comes from
- fedora 44: libqb-devel 2.0.9-2.fc44 Β· LGPL-2.1-or-later
- fedora 44: libqb-devel 2.0.9-2.fc44 Β· LGPL-2.1-or-later
- ubuntu resolute: libqb-dev 2.0.9-1ubuntu1 Β· LGPL-2.1-or-later
- ubuntu stonking: libqb-dev 2.0.9-1ubuntu1 Β· LGPL-2.1-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms