]> git.ipfire.org Git - thirdparty/haproxy.git/commit
MINOR: task: define two new one-shot events for use with WOKEN_OTHER or MSG
authorWilly Tarreau <w@1wt.eu>
Thu, 26 Sep 2024 16:19:10 +0000 (18:19 +0200)
committerWilly Tarreau <w@1wt.eu>
Fri, 27 Sep 2024 09:56:10 +0000 (11:56 +0200)
commitb5281283bb00248152ba361f8d7306b37febbee0
tree3dd5f0ebb8f0d5b878cdcb2a70d7d0e30c896f8a
parentd1c398b7868a9d4977c50458f64ffc294417592c
MINOR: task: define two new one-shot events for use with WOKEN_OTHER or MSG

TASK_WOKEN_MSG only says "someone sent you a message" but doesn't convey
any info about the message. TASK_WOKEN_OTHER says "you're woken for another
reason" but doesn't tell which one. Most often they're used as-is by the
task handlers to report very specific situations.

For some important control notifications, having the ability to modulate
the message a little bit is useful, so let's define two user event types
UEVT1 and UEVT2 to be used in conjunction with TASK_WOKEN_MSG or _OTHER
so that the application can know that a specific condition was explicitly
requested. It will be used this way:

  task_wakeup(s->task, TASK_WOKEN_MSG | TASK_F_UEVT1);
or:
  task_wakeup(s->task, TASK_WOKEN_OTHER | TASK_F_UEVT2);

Since events are cumulative, keep in mind not to consider a 3rd value
as the combination of EVT1+EVT2; these really mean that the two events
appeared (though in unspecified order).
include/haproxy/task-t.h