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>
Wed, 2 Oct 2024 08:17:31 +0000 (10:17 +0200)
commitd88cd382bf6aa6d426385279d78a628b86e71160
treeb21f3057e94028318f0fc035690218d9b829a72b
parent908baaa3992e08544bacfa999bd7136c4f034c5a
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).

(cherry picked from commit b5281283bb00248152ba361f8d7306b37febbee0)
Signed-off-by: Willy Tarreau <w@1wt.eu>
include/haproxy/task-t.h