Mercurial
annotate third_party/libuv/docs/code/ref-timer/main.c @ 279:b3b547563ec7
Add Google connector service and agent wiki
Implement the C/Seobeo Google Drive and Gmail connector with encrypted OAuth storage, Zenbu authentication, browser testing, AI tool discovery, chunked HTTP decoding, and Bazel coverage. Consolidate repository guidance into progressive wiki documentation and enforce arena-first allocation for new first-party C code.
Co-authored-by: Copilot <[email protected]>
Copilot-Session: 84c338fd-0939-4bb3-b7f3-1062eb213e5d
| author | MrJuneJune <me@mrjunejune.com> |
|---|---|
| date | Mon, 17 Aug 2026 22:22:36 -0700 |
| parents | 948de3f54cea |
| children |
| rev | line source |
|---|---|
| 160 | 1 #include <stdio.h> |
| 2 | |
| 3 #include <uv.h> | |
| 4 | |
| 5 uv_loop_t *loop; | |
| 6 uv_timer_t gc_req; | |
| 7 uv_timer_t fake_job_req; | |
| 8 | |
| 9 void gc(uv_timer_t *handle) { | |
| 10 fprintf(stderr, "Freeing unused objects\n"); | |
| 11 } | |
| 12 | |
| 13 void fake_job(uv_timer_t *handle) { | |
| 14 fprintf(stdout, "Fake job done\n"); | |
| 15 } | |
| 16 | |
| 17 int main() { | |
| 18 loop = uv_default_loop(); | |
| 19 | |
| 20 uv_timer_init(loop, &gc_req); | |
| 21 uv_unref((uv_handle_t*) &gc_req); | |
| 22 | |
| 23 uv_timer_start(&gc_req, gc, 0, 2000); | |
| 24 | |
| 25 // could actually be a TCP download or something | |
| 26 uv_timer_init(loop, &fake_job_req); | |
| 27 uv_timer_start(&fake_job_req, fake_job, 9000, 0); | |
| 28 return uv_run(loop, UV_RUN_DEFAULT); | |
| 29 } |