#include <iostream>
struct trace_msg
{
std::string m_what;
std::thread::id m_thread_id;
};
{
[]( const trace_msg & msg ) {
std::cout << msg.m_thread_id << ": (" << msg.m_who
<< ") " << msg.m_what << std::endl;
} );
} );
}
{
&agent, std::move(what), std::this_thread::get_id() );
}
const std::chrono::milliseconds sleeping_time{ 200 };
{
public :
{
trace( *this, "A.e1 started" );
std::this_thread::sleep_for( sleeping_time );
trace( *this, "A.e1 finished" );
},
.event< M3 >( [this] {
trace( *this, "A.e3 started" );
std::this_thread::sleep_for( sleeping_time );
trace( *this, "A.e3 finished" );
} )
}
};
{
public :
{
trace( *this, "B.e2 started" );
std::this_thread::sleep_for( sleeping_time );
trace( *this, "B.e2 finished" );
},
}
};
{
create_logger( env );
pool_disp::bind_params_t{}.fifo( fifo_type ) ),
{
} );
so_5::send< M1 >( m );
so_5::send< M2 >( m );
so_5::send< M3 >( m );
so_5::send< M2 >( m );
so_5::send< M1 >( m );
so_5::send< stop >( m );
} );
}
int main()
{
try
{
std::cout << "cooperation FIFO..." << std::endl;
std::cout << "individual FIFO..." << std::endl;
}
catch( const std::exception & ex )
{
std::cerr << "Error: " << ex.what() << std::endl;
}
return 0;
}