corvusoft / runloop Goto Github PK
View Code? Open in Web Editor NEWEvent processing loop for scheduling and coordinating asynchronous work; fire and forget.
Home Page: http://www.corvusoft.co.uk
License: Other
Event processing loop for scheduling and coordinating asynchronous work; fire and forget.
Home Page: http://www.corvusoft.co.uk
License: Other
Or should we detect this during compile time?
volatile static std::sig_atomic_t raised_signal = 0;
static std::atomic< std::sig_atomic_t > raised_signal( 0 );
Further Reading
We should be checking for compiler features and not against specific compilers.
Runloop loop;
loop->launch( task1, "my-key" );
loop->launch_after( "my-key", task2 );
//document that if a task is already executing it will complete before sleeping. //if a task wants to determine at runtime if it is suspended it may call is_suspended( ); void RunLoop::suspend( void )
// Note if you have tasks with unmet conditions via launch_if and/or launch_at. the loop::wait method // will block until successful completion of all tasks. //This function may block for longer than timeout_duration due to scheduling or resource contention delays. error_code RunLoop::wait( const milliseconds& duration )
//cancel tasks that have not yet executed.
void RunLoop::cancel( const string& key )
/* * Note that when a sighandler is running you may miss other signals of the same number until * your handler has finished. that is to state a signal handler for a specific signum is * no able to run consecutively, you can't have the same handler running concurrently. * if you throw an exception from a handler you will need to reschedule the handler yourself! */ void RunLoop::launch_on( const signal_t value, const function< error_code ( void ) >& task, const string& key )
void RunLoop::set_log_handler( const function< error_code ( const string&, const error_code&, const string& ) >& value ) { suspend( ); //document me on api, this is bad unless suspend waits fro all takes to sleep. m_pimpl->log_handler = value; resume( ); } void RunLoop::set_error_handler( const function< error_code ( const string&, const error_code&, const string& ) >& value ) { suspend( ); //doc me, this is bad unless suspend waits fro all takes to sleep. m_pimpl->error_handler = value; resume( ); }
Currently we see a few build warnings for G++ on Linux platforms, Silence them!
Runloop loop;
loop->launch_in( seconds( 5 ), task );
This will launch a task in 5 seconds and can be rescheduled by sending back an appropriate code, EAGAIN?
Place the logger into its own project as its a commonly shared resource.
auto loop = make_shared< RunLoop >( );
loop->launch_schedule( "0 0,12 1 */2 *", ... );
The ability to flush a number of pending tasks without calling start.
auto loop = make_shared< RunLoop >( );
loop->launch( ... );
loop->launch( ... );
loop->digest( 1 );
To reduce code and for those tasks where you just don't care.
void launch( const std::function< std::error_code ( void ) >& task, const std::string& key = "" );
void launch( const std::function< void ( void ) >& task, const std::string& key = "" );
Create feature test for resusme_suspend.cpp
Windows... trouble as always. The build needs to account for .lib extensions.
Make TravisCI and AppVeyor builds public.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.