libzypp: zyppng::ProvideQueue Class Reference

libzypp 17.36.6

Classes | Public Types | Public Member Functions | Static Public Attributes | Private Member Functions | Private Attributes | Friends | List of all members
zyppng::ProvideQueue Class Reference

`#include <zypp-media/ng/private/providequeue_p.h>`

Inheritance diagram for zyppng::ProvideQueue:

## Classes
struct | Item

## Public Types
using | Config = zyppng::WorkerCaps
using | TimePoint = std::chrono::time_point<std::chrono::steady_clock>
Public Types inherited from zyppng::Base
using | Ptr = std::shared_ptr<Base>
using | WeakPtr = std::weak_ptr<Base>

## Public Member Functions
| ProvideQueue (ProvidePrivate &parent)
| ~ProvideQueue ()
bool | startup (const std::string &workerScheme, const zypp::Pathname &workDir, const std::string &hostname="")
void | enqueue (ProvideRequestRef request)
void | cancel (ProvideRequest *item, std::exception_ptr error)
void | detach (const std::string &id)
void | scheduleNext ()
bool | canScheduleMore () const
bool | empty () const
bool | isIdle () const
std::optional< TimePoint > | idleSince () const
uint | requestCount () const
uint | activeRequests () const
zypp::ByteCount | expectedProvideSize () const
const std::string & | hostname () const
const Config & | workerConfig () const
SignalProxy< void()> | sigIdle ()
Public Member Functions inherited from zyppng::Base
| Base ()
virtual | ~Base ()
WeakPtr | parent () const
void | addChild (const Base::Ptr &child)
void | removeChild (const Ptr &child)
const std::unordered_set< Ptr > & | children () const
std::thread::id | threadId () const
template<typename T>
std::vector< std::weak_ptr< T > > | findChildren () const
template<typename T>
std::shared_ptr< T > | shared_this () const
template<typename T>
std::shared_ptr< T > | shared_this ()
template<typename T>
std::weak_ptr< T > | weak_this () const
template<typename T>
std::weak_ptr< T > | weak_this ()
template<typename SenderFunc, typename ReceiverFunc>
auto | connect (SenderFunc &&sFun, typename internal::MemberFunction< ReceiverFunc >::ClassType &recv, ReceiverFunc &&rFunc)
template<typename SenderFunc, typename ReceiverFunc, typename ... Tracker>
std::enable_if_t< std::is_member_function_pointer_v< SenderFunc >, connection > | connectFunc (SenderFunc &&sFun, ReceiverFunc &&rFunc, const Tracker &...trackers)

## Static Public Attributes
static constexpr uint32_t | InvalidId = (uint32_t) -1

## Private Member Functions
bool | doStartup ()
void | processMessage ()
void | readAllStderr ()
void | forwardToLog (std::string &&logLine)
void | processReadyRead (int channel)
void | procFinished (int exitCode)
uint32_t | nextRequestId ()
std::list< ProvideQueue::Item >::iterator | dequeueActive (std::list< Item >::iterator it)
void | fatalWorkerError (const std::exception_ptr &reason=nullptr)
void | immediateShutdown (const std::exception_ptr &reason)
std::list< ProvideQueue::Item >::iterator | cancelActiveItem (std::list< Item >::iterator i, const std::exception_ptr &error)

## Private Attributes
bool | _queueShuttingDown = false
uint8_t | _crashCounter = 0
Config | _capabilities
zypp::Pathname | _currentExe
std::string | _myHostname
ProvidePrivate & | _parent
std::deque< Item > | _waitQueue
std::list< Item > | _activeItems
Process::Ptr | _workerProc
StompFrameStreamRef | _messageStream
Signal< void()> | _sigIdle
std::optional< TimePoint > | _idleSince

## Friends
struct | ProvideResourceData

## Additional Inherited Members
Static Public Member Functions inherited from zyppng::Base
template<typename Obj, typename Functor>
static decltype(auto) | make_base_slot (Obj *o, Functor &&f)
template<typename SenderFunc, typename ReceiverFunc>
static auto | connect (typename internal::MemberFunction< SenderFunc >::ClassType &s, SenderFunc &&sFun, typename internal::MemberFunction< ReceiverFunc >::ClassType &recv, ReceiverFunc &&rFunc)
template<typename SenderFunc, typename ReceiverFunc, typename ... Tracker>
static auto | connectFunc (typename internal::MemberFunction< SenderFunc >::ClassType &s, SenderFunc &&sFun, ReceiverFunc &&rFunc, const Tracker &...trackers)
Protected Member Functions inherited from zyppng::Base
| Base (BasePrivate &dd)
Protected Attributes inherited from zyppng::Base
std::unique_ptr< BasePrivate > | d_ptr

## Detailed Description

Definition at line 30 of file providequeue_p.h.

## Member Typedef Documentation

## ◆ Config

using zyppng::ProvideQueue::Config = zyppng::WorkerCaps

Definition at line 36 of file providequeue_p.h.

## ◆ TimePoint

using zyppng::ProvideQueue::TimePoint = std::chrono::time_point<std::chrono::steady_clock>

Definition at line 38 of file providequeue_p.h.

## Constructor & Destructor Documentation

## ◆ ProvideQueue()

zyppng::ProvideQueue::ProvideQueue | ( | ProvidePrivate & | parent | ) |

Definition at line 48 of file providequeue.cc.

## ◆ ~ProvideQueue()

zyppng::ProvideQueue::~ProvideQueue | ( |  | ) |

Definition at line 51 of file providequeue.cc.

## Member Function Documentation

## ◆ startup()

bool zyppng::ProvideQueue::startup | ( | const std::string & | workerScheme,
|  | const zypp::Pathname & | workDir,
|  | const std::string & | hostname = "" )

Definition at line 61 of file providequeue.cc.

## ◆ enqueue()

void zyppng::ProvideQueue::enqueue | ( | ProvideRequestRef | request | ) |

Definition at line 96 of file providequeue.cc.

## ◆ cancel()

void zyppng::ProvideQueue::cancel | ( | ProvideRequest * | item,
|  | std::exception_ptr | error )

Definition at line 107 of file providequeue.cc.

## ◆ detach()

void zyppng::ProvideQueue::detach | ( | const std::string & | id | ) |

## ◆ scheduleNext()

void zyppng::ProvideQueue::scheduleNext | ( |  | ) |

Definition at line 213 of file providequeue.cc.

## ◆ canScheduleMore()

bool zyppng::ProvideQueue::canScheduleMore | ( |  | ) | const

Definition at line 249 of file providequeue.cc.

## ◆ empty()

bool zyppng::ProvideQueue::empty | ( |  | ) | const

Definition at line 264 of file providequeue.cc.

## ◆ isIdle()

bool zyppng::ProvideQueue::isIdle | ( |  | ) | const

Check if the queue is currently idle

Definition at line 254 of file providequeue.cc.

## ◆ idleSince()

std::optional< ProvideQueue::TimePoint > zyppng::ProvideQueue::idleSince | ( |  | ) | const

Time point since the queue started to be idle

Definition at line 259 of file providequeue.cc.

## ◆ requestCount()

uint zyppng::ProvideQueue::requestCount | ( |  | ) | const

How many items does this queue currently have

Definition at line 269 of file providequeue.cc.

## ◆ activeRequests()

uint zyppng::ProvideQueue::activeRequests | ( |  | ) | const

How many active items does this queue currently have

Definition at line 274 of file providequeue.cc.

## ◆ expectedProvideSize()

zypp::ByteCount zyppng::ProvideQueue::expectedProvideSize | ( |  | ) | const

How much bytes does this queue has to download / process, for pending requests this is only set if the ProvideSpec has a expected download size set.

Definition at line 279 of file providequeue.cc.

## ◆ hostname()

const std::string & zyppng::ProvideQueue::hostname | ( |  | ) | const

Returns the hostname this worker belongs to. If the worker was not associated with a hostname this will return a empty string.

Definition at line 302 of file providequeue.cc.

## ◆ workerConfig()

const ProvideQueue::Config & zyppng::ProvideQueue::workerConfig | ( |  | ) | const

Definition at line 307 of file providequeue.cc.

## ◆ sigIdle()

SignalProxy< void()> zyppng::ProvideQueue::sigIdle | ( |  | ) |

Definition at line 312 of file providequeue.cc.

## ◆ doStartup()

bool zyppng::ProvideQueue::doStartup | ( |  | ) |
| private

Definition at line 317 of file providequeue.cc.

## ◆ processMessage()

void zyppng::ProvideQueue::processMessage | ( |  | ) |
| private

Definition at line 387 of file providequeue.cc.

## ◆ readAllStderr()

void zyppng::ProvideQueue::readAllStderr | ( |  | ) |
| private

Reads all of the log lines from stderr, call only when shutting down the queue because this will also read partial lines and forwards them

Definition at line 715 of file providequeue.cc.

## ◆ forwardToLog()

void zyppng::ProvideQueue::forwardToLog | ( | std::string && | logLine | ) |
| private

Definition at line 725 of file providequeue.cc.

## ◆ processReadyRead()

void zyppng::ProvideQueue::processReadyRead | ( | int | channel | ) |
| private

Definition at line 733 of file providequeue.cc.

## ◆ procFinished()

void zyppng::ProvideQueue::procFinished | ( | int | exitCode | ) |
| private

Definition at line 749 of file providequeue.cc.

## ◆ nextRequestId()

uint32_t zyppng::ProvideQueue::nextRequestId | ( |  | ) |
| private

Definition at line 781 of file providequeue.cc.

## ◆ dequeueActive()

std::list< ProvideQueue::Item >::iterator zyppng::ProvideQueue::dequeueActive | ( | std::list< Item >::iterator | it | ) |
| private

Dequeues the request referenced by it. Returns a iterator to the next element in the active list

Definition at line 136 of file providequeue.cc.

## ◆ fatalWorkerError()

void zyppng::ProvideQueue::fatalWorkerError | ( | const std::exception_ptr & | reason = nullptr | ) |
| private

Definition at line 150 of file providequeue.cc.

## ◆ immediateShutdown()

void zyppng::ProvideQueue::immediateShutdown | ( | const std::exception_ptr & | reason | ) |
| private

Definition at line 155 of file providequeue.cc.

## ◆ cancelActiveItem()

std::list< ProvideQueue::Item >::iterator zyppng::ProvideQueue::cancelActiveItem | ( | std::list< Item >::iterator | i,
|  | const std::exception_ptr & | error )
| private

Cancels the item the iterator i is pointing to, advancing the iterator to the next element in the list

Definition at line 184 of file providequeue.cc.

## Friends And Related Symbol Documentation

## ◆ ProvideResourceData

friend struct ProvideResourceData
| friend

Definition at line 33 of file providequeue_p.h.

## Member Data Documentation

## ◆ InvalidId

uint32_t zyppng::ProvideQueue::InvalidId = (uint32_t) -1
| staticconstexpr

Definition at line 35 of file providequeue_p.h.

## ◆ _queueShuttingDown

bool zyppng::ProvideQueue::_queueShuttingDown = false
| private

Definition at line 127 of file providequeue_p.h.

## ◆ _crashCounter

uint8_t zyppng::ProvideQueue::_crashCounter = 0
| private

Definition at line 128 of file providequeue_p.h.

## ◆ _capabilities

Config zyppng::ProvideQueue::_capabilities
| private

Definition at line 129 of file providequeue_p.h.

## ◆ _currentExe

zypp::Pathname zyppng::ProvideQueue::_currentExe
| private

Definition at line 130 of file providequeue_p.h.

## ◆ _myHostname

std::string zyppng::ProvideQueue::_myHostname
| private

Definition at line 131 of file providequeue_p.h.

## ◆ _parent

ProvidePrivate& zyppng::ProvideQueue::_parent
| private

Definition at line 132 of file providequeue_p.h.

## ◆ _waitQueue

std::deque< Item > zyppng::ProvideQueue::_waitQueue
| private

Definition at line 133 of file providequeue_p.h.

## ◆ _activeItems

std::list< Item > zyppng::ProvideQueue::_activeItems
| private

Definition at line 134 of file providequeue_p.h.

## ◆ _workerProc

Process::Ptr zyppng::ProvideQueue::_workerProc
| private

Definition at line 135 of file providequeue_p.h.

## ◆ _messageStream

StompFrameStreamRef zyppng::ProvideQueue::_messageStream
| private

Definition at line 136 of file providequeue_p.h.

## ◆ _sigIdle

Signal<void()> zyppng::ProvideQueue::_sigIdle
| private

Definition at line 137 of file providequeue_p.h.

## ◆ _idleSince

std::optional<TimePoint> zyppng::ProvideQueue::_idleSince
| private

Definition at line 138 of file providequeue_p.h.

The documentation for this class was generated from the following files:

- zypp-media/ng/private/providequeue_p.h
- zypp-media/ng/providequeue.cc