2 * Copyright (C) 2020 Jérémie Galarneau <jeremie.galarneau@efficios.com>
4 * SPDX-License-Identifier: GPL-2.0-only
8 #ifndef ACTION_EXECUTOR_H
9 #define ACTION_EXECUTOR_H
11 struct action_executor
;
12 struct notification_thread_handle
;
13 struct lttng_evaluation
;
15 struct notification_client_list
;
16 struct lttng_credentials
;
18 enum action_executor_status
{
19 ACTION_EXECUTOR_STATUS_OK
,
20 ACTION_EXECUTOR_STATUS_OVERFLOW
,
21 ACTION_EXECUTOR_STATUS_ERROR
,
22 ACTION_EXECUTOR_STATUS_INVALID
,
25 struct action_executor
*action_executor_create(
26 struct notification_thread_handle
*handle
);
28 void action_executor_destroy(struct action_executor
*executor
);
31 * Enqueue a job on an action executor's work queue to perform the actions
32 * associated with a trigger.
34 * A reference to `trigger` is acquired.
35 * A reference to `list` is acquired.
37 * This function assumes the ownership of the `evaluation` both on success and
38 * failure: the caller should no longer access it once the function returns.
40 enum action_executor_status
action_executor_enqueue(
41 struct action_executor
*executor
,
42 struct lttng_trigger
*trigger
,
43 struct lttng_evaluation
*evaluation
,
44 const struct lttng_credentials
*object_creds
,
45 struct notification_client_list
*list
);
47 #endif /* ACTION_EXECUTOR_H */