58 -> common::VoidResult {
59 return common::error_info{-120,
"queue is full, rejecting new item",
"thread_system"};
66 [[nodiscard]]
static constexpr auto blocks() noexcept ->
bool {
74 [[nodiscard]]
static constexpr auto name() noexcept -> const
char* {
75 return "overflow_reject";
110 -> std::pair<common::VoidResult, std::unique_ptr<job>> {
112 return {common::error_info{-123,
"queue full, waiting for space",
"thread_system"},
120 [[nodiscard]]
static constexpr auto blocks() noexcept ->
bool {
128 [[nodiscard]]
static constexpr auto name() noexcept -> const
char* {
129 return "overflow_block";
161 -> std::pair<bool, std::unique_ptr<job>> {
163 return {
true, std::move(value)};
170 [[nodiscard]]
static constexpr auto blocks() noexcept ->
bool {
186 [[nodiscard]]
static constexpr auto name() noexcept -> const
char* {
187 return "overflow_drop_oldest";
217 -> common::VoidResult {
226 [[nodiscard]]
static constexpr auto blocks() noexcept ->
bool {
242 [[nodiscard]]
static constexpr auto name() noexcept -> const
char* {
243 return "overflow_drop_newest";
282 [[nodiscard]]
auto timeout() const noexcept ->
std::chrono::milliseconds {
300 -> std::pair<common::VoidResult, std::unique_ptr<job>> {
301 return {common::error_info{-123,
"queue full, waiting with timeout",
"thread_system"},
309 [[nodiscard]]
static constexpr auto blocks() noexcept ->
bool {
317 [[nodiscard]]
static constexpr auto name() noexcept -> const
char* {
318 return "overflow_timeout";
Policy that blocks until space is available.
auto handle_overflow(std::unique_ptr< job > &&value) -> std::pair< common::VoidResult, std::unique_ptr< job > >
Handle overflow by indicating need to wait.
static constexpr auto name() noexcept -> const char *
Get a descriptive name for this policy.
static constexpr auto blocks() noexcept -> bool
Check if this policy blocks on overflow.
Policy that rejects new item when queue is full (same as reject)
static constexpr auto name() noexcept -> const char *
Get a descriptive name for this policy.
static constexpr auto blocks() noexcept -> bool
Check if this policy blocks on overflow.
static constexpr auto drops_newest() noexcept -> bool
Check if this policy drops items on overflow.
auto handle_overflow(std::unique_ptr< job > &&) -> common::VoidResult
Handle overflow by dropping the new item silently.
Policy that drops the oldest item when queue is full.
static constexpr auto blocks() noexcept -> bool
Check if this policy blocks on overflow.
static constexpr auto drops_oldest() noexcept -> bool
Check if this policy drops items on overflow.
static constexpr auto name() noexcept -> const char *
Get a descriptive name for this policy.
auto handle_overflow(std::unique_ptr< job > &&value) -> std::pair< bool, std::unique_ptr< job > >
Handle overflow by requesting oldest item removal.
Policy that rejects new items when queue is full.
static constexpr auto blocks() noexcept -> bool
Check if this policy blocks on overflow.
static constexpr auto name() noexcept -> const char *
Get a descriptive name for this policy.
auto handle_overflow(std::unique_ptr< job > &&) -> common::VoidResult
Handle overflow by rejecting the new item.
Policy that blocks for a limited time when queue is full.
static constexpr auto blocks() noexcept -> bool
Check if this policy blocks on overflow.
static constexpr auto name() noexcept -> const char *
Get a descriptive name for this policy.
overflow_timeout_policy(std::chrono::milliseconds timeout)
Construct with timeout duration.
std::chrono::milliseconds timeout_
auto handle_overflow(std::unique_ptr< job > &&value) -> std::pair< common::VoidResult, std::unique_ptr< job > >
Handle overflow by indicating need to wait with timeout.
auto set_timeout(std::chrono::milliseconds timeout) noexcept -> void
Set new timeout duration.
overflow_timeout_policy()
Default constructor with 1 second timeout.
auto timeout() const noexcept -> std::chrono::milliseconds
Get the configured timeout.
Error codes and utilities for the thread system.
Base job class for schedulable work units in the thread system.
Tag type for overflow policy identification.