Wire Sysio Wire Sysion 1.0.0
Loading...
Searching...
No Matches
boost::fibers::asio::round_robin::service Struct Reference

#include <round_robin.hpp>

Inheritance diagram for boost::fibers::asio::round_robin::service:
Collaboration diagram for boost::fibers::asio::round_robin::service:

Public Member Functions

 service (boost::asio::io_service &io_svc)
 
virtual ~service ()
 
 service (service const &)=delete
 
serviceoperator= (service const &)=delete
 
void shutdown_service () override final
 

Public Attributes

std::unique_ptr< boost::asio::io_service::work > work_
 

Static Public Attributes

static boost::asio::io_service::id id
 

Detailed Description

Definition at line 47 of file round_robin.hpp.

Constructor & Destructor Documentation

◆ service() [1/2]

boost::fibers::asio::round_robin::service::service ( boost::asio::io_service & io_svc)
inline

Definition at line 52 of file round_robin.hpp.

52 :
53 boost::asio::io_service::service( io_svc),
54 work_{ new boost::asio::io_service::work( io_svc) } {
55 io_svc.post([&io_svc](){
56//]
57//[asio_rr_service_lambda
58 while ( ! io_svc.stopped() ) {
59 if ( boost::fibers::has_ready_fibers() ) {
60 // run all pending handlers in round_robin
61 while ( io_svc.poll() );
62 // run pending (ready) fibers
63 this_fiber::yield();
64 } else {
65 // run one handler inside io_service
66 // if no handler available, block this thread
67 if ( ! io_svc.run_one() ) {
68 break;
69 }
70 }
71 }
72//]
73//[asio_rr_service_bottom
74 });
75 }
std::unique_ptr< boost::asio::io_service::work > work_

◆ ~service()

virtual boost::fibers::asio::round_robin::service::~service ( )
inlinevirtual

Definition at line 77 of file round_robin.hpp.

77{}

◆ service() [2/2]

boost::fibers::asio::round_robin::service::service ( service const & )
delete

Member Function Documentation

◆ operator=()

service & boost::fibers::asio::round_robin::service::operator= ( service const & )
delete

◆ shutdown_service()

void boost::fibers::asio::round_robin::service::shutdown_service ( )
inlinefinaloverride

Definition at line 82 of file round_robin.hpp.

82 {
83 work_.reset();
84 }

Member Data Documentation

◆ id

boost::asio::io_service::id boost::fibers::asio::round_robin::service::id
static

Definition at line 48 of file round_robin.hpp.

◆ work_

std::unique_ptr< boost::asio::io_service::work > boost::fibers::asio::round_robin::service::work_

Definition at line 50 of file round_robin.hpp.


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