libkazv
Kazv::CprJobHandler Struct Reference

#include <cprjobhandler.hpp>

Inheritance diagram for Kazv::CprJobHandler:
Collaboration diagram for Kazv::CprJobHandler:

Classes

struct  Private
 

Public Member Functions

 CprJobHandler (boost::asio::io_context::executor_type executor)
 
 ~CprJobHandler () override
 
void async (std::function< void()> func) override
 
void setTimeout (std::function< void()> func, int ms, std::optional< std::string > timerId=std::nullopt) override
 
void setInterval (std::function< void()> func, int ms, std::optional< std::string > timerId=std::nullopt) override
 
void cancel (std::string timerId) override
 cancels all pending timers with timerId More...
 
void submit (BaseJob job, std::function< void(Response)> callback) override
 makes an async fetch. More...
 
void stop ()
 
- Public Member Functions inherited from Kazv::JobInterface
virtual ~JobInterface ()=default
 

Constructor & Destructor Documentation

◆ CprJobHandler()

Kazv::CprJobHandler::CprJobHandler ( boost::asio::io_context::executor_type  executor)

◆ ~CprJobHandler()

Kazv::CprJobHandler::~CprJobHandler ( )
overridedefault

Member Function Documentation

◆ async()

void Kazv::CprJobHandler::async ( std::function< void()>  func)
overridevirtual

Implements Kazv::JobInterface.

◆ cancel()

void Kazv::CprJobHandler::cancel ( std::string  timerId)
overridevirtual

cancels all pending timers with timerId

Implements Kazv::JobInterface.

◆ setInterval()

void Kazv::CprJobHandler::setInterval ( std::function< void()>  func,
int  ms,
std::optional< std::string >  timerId = std::nullopt 
)
overridevirtual

Implements Kazv::JobInterface.

◆ setTimeout()

void Kazv::CprJobHandler::setTimeout ( std::function< void()>  func,
int  ms,
std::optional< std::string >  timerId = std::nullopt 
)
overridevirtual

Implements Kazv::JobInterface.

◆ stop()

void Kazv::CprJobHandler::stop ( )

◆ submit()

void Kazv::CprJobHandler::submit ( BaseJob  job,
std::function< void(Response)>  callback 
)
overridevirtual

makes an async fetch.

callback should not block the current thread. if job has a queueId, it must be queued and executed only after every job before it in the queue queueId returned. if job has a queuePolicy of CancelFutureIfFailed, the failure of this job must remove every other job after it in the queue queueId.

Implements Kazv::JobInterface.


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