TICKIT_WATCH_TIMER_AFTER_TV(3)
π TICKIT_WATCH_TIMER_AFTER_MSEC π
okay bestie, welcome to the Library Functions Manual, section 3 β this is TICKIT_WATCH_TIMER_AFTER_MSEC(3) and she's here to teach you how to make stuff happen later. like, a set amount of later. very demure, very mindful, very "call me back in 500ms" energy. πβ¨
β¨ NAME β¨
tickit_watch_timer_after_* β invoke a callback after a fixed delay
π¦ SYNOPSIS π¦
#include <tickit.h>
typedef int TickitCallbackFn(Tickit *t, TickitEventflags flags,
void *info, void *user);
void *tickit_watch_timer_after_msec(Tickit *t, int msec,
TickitBindFlags flags, TickitCallbackFn *fn, void *user);
void *tickit_watch_timer_after_tv(Tickit *t, const struct timeval *after,
TickitBindFlags flags, TickitCallbackFn *fn, void *user);
Link with -ltickit.
πΈ DESCRIPTION πΈ
so the tickit_watch_timer_after_*() girlies are a whole family of functions that register a callback function to get invoked by the toplevel event loop a fixed delay afterwards. like you're basically sliding into the event loop's DMs and being like "hey bestie, ping me in a sec, k?"
A registered callback will be invoked by a running call to tickit_run(3). once and done β the callback function gets invoked exactly one time, and then it's destroyed afterwards. she served her purpose and she's leaving the group chat. π
Each function returns an opaque pointer value which serves to identify this instance β that's your lil name tag for the whole thing, iykyk.
The info pointer will be NULL. not me showing up with no info π that's just how it is bestie.
When invoked, the callback function is always passed both TICKIT_EV_FIRE and TICKIT_EV_UNBIND flags to its flags argument. both. every time. no cap. π₯
If the callback had been registered with the TICKIT_BIND_DESTROY flag, then it will also be invoked with the TICKIT_EV_DESTROY flag if it has not yet been invoked by the time the toplevel instance is destroyed. so like, if the whole toplevel gets yeeted before your callback ever got its moment? it still gets called, just with the destroy flag instead. she gets her goodbye either way π«Ά
If cancelled by tickit_watch_cancel(3) the callback function is invoked with just the TICKIT_EV_UNBIND flag if it had been registered with TICKIT_BIND_UNBIND. only that one flag. don't be out here expecting a whole parade of flags when it's literally just the one, okay? π
π RETURN VALUE π
tickit_watch_timer_after_msec() and tickit_watch_timer_after_tv() return an opaque identifier pointer. that's it. that's the tea. β¨
π SEE ALSO π
tickit_new_stdio(3)tickit_watch_io(3)tickit_watch_timer_at_epoch(3)tickit_watch_later(3)tickit_watch_signal(3)tickit_watch_process(3)tickit_watch_cancel(3)tickit(7)
and that's the whole page bestie!! π this was TICKIT_WAT..._AFTER_MSEC(3) from the Library Functions Manual β the footer's literally just her name again, echoing back at you like a lil mirror, and there's no date or version printed on this one so don't come for me about it. go forth and schedule ur callbacks. slay. πβπ
π¦ where this page comes from
- alpine 3.24: libtickit-doc 0.4.6-r0 Β· MIT
- debian bookworm: libtickit-dev 0.4.3-1 Β· MIT
- debian trixie: libtickit-dev 0.4.3-2 Β· MIT
- fedora 43: libtickit-devel 0.4.5-2.fc43 Β· MIT
- fedora 43: libtickit-devel 0.4.5-2.fc43 Β· MIT
- fedora 44: libtickit-devel 0.4.5-3.fc44 Β· MIT
- fedora 44: libtickit-devel 0.4.5-3.fc44 Β· MIT
- nixos 26.05: libtickit 0.4.5
- nixpkgs unstable: libtickit 0.4.6
- ubuntu noble: libtickit-dev 0.4.3-1.1build1 Β· MIT
- ubuntu questing: libtickit-dev 0.4.3-2
- ubuntu resolute: libtickit-dev 0.4.3-2build1 Β· MIT
- ubuntu stonking: libtickit-dev 0.4.3-2build1 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms