14#ifndef ZYPP_MEDIA_PRIVATE_PROVIDE_QUEUE_P_H_INCLUDED
15#define ZYPP_MEDIA_PRIVATE_PROVIDE_QUEUE_P_H_INCLUDED
18#include <zypp-media/ng/Provide>
19#include <zypp-proto/media/provider.pb.h>
20#include <zypp-core/zyppng/io/Process>
21#include <zypp-core/ByteCount.h>
29 class RpcMessageStream;
37 static constexpr uint32_t
InvalidId = (uint32_t) -1;
38 using Config = zypp::proto::Capabilities;
40 using TimePoint = std::chrono::time_point<std::chrono::steady_clock>;
62 void enqueue ( ProvideRequestRef request );
64 void detach (
const std::string &
id );
77 std::optional<TimePoint>
idleSince ()
const;
100 const std::string &
hostname ()
const;
119 std::list< ProvideQueue::Item >::iterator
dequeueActive ( std::list<Item>::iterator it );
126 std::list< ProvideQueue::Item >::iterator
cancelActiveItem (std::list<Item>::iterator i,
const std::exception_ptr &error );
Store and operate with byte count.
RpcMessageStreamPtr _messageStream
std::chrono::time_point< std::chrono::steady_clock > TimePoint
std::list< ProvideQueue::Item >::iterator cancelActiveItem(std::list< Item >::iterator i, const std::exception_ptr &error)
zypp::ByteCount expectedProvideSize() const
void immediateShutdown(const std::exception_ptr &reason)
std::deque< Item > _waitQueue
void cancel(ProvideRequest *item, std::exception_ptr error)
uint requestCount() const
zypp::Pathname _currentExe
bool canScheduleMore() const
zypp::proto::Capabilities Config
void processReadyRead(int channel)
const std::string & hostname() const
std::optional< TimePoint > _idleSince
bool startup(const std::string &workerScheme, const zypp::Pathname &workDir, const std::string &hostname="")
const Config & workerConfig() const
std::optional< TimePoint > idleSince() const
void procFinished(int exitCode)
uint activeRequests() const
std::list< Item > _activeItems
void forwardToLog(std::string &&logLine)
void enqueue(ProvideRequestRef request)
SignalProxy< void()> sigIdle()
void detach(const std::string &id)
std::list< ProvideQueue::Item >::iterator dequeueActive(std::list< Item >::iterator it)
void fatalWorkerError(const std::exception_ptr &reason=nullptr)
static constexpr uint32_t InvalidId
std::shared_ptr< RpcMessageStream > RpcMessageStreamPtr
bool isDetachRequest() const
ProvideRequestRef _request
bool isAttachRequest() const
bool isFileRequest() const