#include <packets_queue.hpp>
◆ PacketsQueue()
taraxa::network::threadpool::PacketsQueue::PacketsQueue |
( |
| ) |
|
|
default |
◆ decrementActWorkersCount()
void taraxa::network::threadpool::PacketsQueue::decrementActWorkersCount |
( |
| ) |
|
Decrement act_workers_count_ by 1.
◆ empty()
bool taraxa::network::threadpool::PacketsQueue::empty |
( |
| ) |
const |
- Note
- This method is thread-safe
- Returns
- true if queue is empty, otherwise false
◆ getActiveWorkersNum()
size_t taraxa::network::threadpool::PacketsQueue::getActiveWorkersNum |
( |
| ) |
const |
- Note
- This method is thread-safe
- Returns
- number of workers that are currently processing packets from this queue
◆ incrementActWorkersCount()
void taraxa::network::threadpool::PacketsQueue::incrementActWorkersCount |
( |
| ) |
|
Increment act_workers_count_ by 1.
◆ maxWorkersCountReached()
bool taraxa::network::threadpool::PacketsQueue::maxWorkersCountReached |
( |
| ) |
const |
- Returns
- false in case there is already kMaxWorkersCount_ workers processing packets from this queue at the same time, otherwise true
◆ pop()
Return Task from queue. In some rare situations when all packets are blocked for processing due to blocking dependencies there might returned empty optional.
- Note
- If empty optional is returned too often, there might be some logical bug in terms of packet priority & existing dependencies
- Parameters
-
blocked_packets_types_mask | bit mask with all blocked packets for processing |
- Returns
- std::optional<Task>
◆ pushBack()
Push new task to the queue.
- Parameters
-
◆ setMaxWorkersCount()
void taraxa::network::threadpool::PacketsQueue::setMaxWorkersCount |
( |
size_t |
max_workers_count | ) |
|
Set new max workers count.
- Parameters
-
◆ size()
size_t taraxa::network::threadpool::PacketsQueue::size |
( |
| ) |
const |
- Note
- This method is thread-safe
- Returns
- size of the queue
◆ act_packets_count_
std::atomic<size_t> taraxa::network::threadpool::PacketsQueue::act_packets_count_ {0} |
|
private |
◆ act_workers_count_
std::atomic<size_t> taraxa::network::threadpool::PacketsQueue::act_workers_count_ {0} |
|
private |
◆ kMaxWorkersCount_
size_t taraxa::network::threadpool::PacketsQueue::kMaxWorkersCount_ {0} |
|
private |
◆ packets_
The documentation for this class was generated from the following files: