1 /* SPDX-License-Identifier: GPL-2.0-only */
3 * Copyright 2023 Red Hat
6 #ifndef UDS_REQUEST_QUEUE_H
7 #define UDS_REQUEST_QUEUE_H
12 * A simple request queue which will handle new requests in the order in which they are received,
13 * and will attempt to handle requeued requests before new ones. However, the nature of the
14 * implementation means that it cannot guarantee this ordering; the prioritization is merely a
18 struct uds_request_queue
;
20 typedef void (*uds_request_queue_processor_fn
)(struct uds_request
*);
22 int __must_check
uds_make_request_queue(const char *queue_name
,
23 uds_request_queue_processor_fn processor
,
24 struct uds_request_queue
**queue_ptr
);
26 void uds_request_queue_enqueue(struct uds_request_queue
*queue
,
27 struct uds_request
*request
);
29 void uds_request_queue_finish(struct uds_request_queue
*queue
);
31 #endif /* UDS_REQUEST_QUEUE_H */