|
Thread System 0.3.1
High-performance C++20 thread pool with work stealing and DAG scheduling
|
Policy that blocks for a limited time when queue is full. More...
#include <overflow_policies.h>

Public Types | |
| using | policy_tag = overflow_policy_tag |
Public Member Functions | |
| overflow_timeout_policy (std::chrono::milliseconds timeout) | |
| Construct with timeout duration. | |
| overflow_timeout_policy () | |
| Default constructor with 1 second timeout. | |
| auto | timeout () const noexcept -> std::chrono::milliseconds |
| Get the configured timeout. | |
| auto | set_timeout (std::chrono::milliseconds timeout) noexcept -> void |
| Set new timeout duration. | |
| 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. | |
Static Public Member Functions | |
| 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. | |
Private Attributes | |
| std::chrono::milliseconds | timeout_ |
Policy that blocks for a limited time when queue is full.
When the queue is full, the enqueue operation blocks for up to the configured timeout duration. If space doesn't become available within the timeout, the operation fails.
Definition at line 262 of file overflow_policies.h.
Definition at line 264 of file overflow_policies.h.
|
inlineexplicit |
Construct with timeout duration.
| timeout | Maximum time to wait for space |
Definition at line 270 of file overflow_policies.h.
|
inline |
Default constructor with 1 second timeout.
Definition at line 276 of file overflow_policies.h.
|
inlinestaticnodiscardconstexprnoexcept |
Check if this policy blocks on overflow.
Definition at line 309 of file overflow_policies.h.
|
inlinenodiscard |
Handle overflow by indicating need to wait with timeout.
| value | The job to be added |
Definition at line 299 of file overflow_policies.h.
|
inlinestaticnodiscardconstexprnoexcept |
Get a descriptive name for this policy.
Definition at line 317 of file overflow_policies.h.
|
inlinenoexcept |
|
inlinenodiscardnoexcept |
Get the configured timeout.
Definition at line 282 of file overflow_policies.h.
References timeout_.
Referenced by set_timeout().

|
private |
Definition at line 322 of file overflow_policies.h.
Referenced by set_timeout(), and timeout().