Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document API #5

Open
ben-crowhurst opened this issue May 6, 2017 · 0 comments
Open

Document API #5

ben-crowhurst opened this issue May 6, 2017 · 0 comments
Labels
Milestone

Comments

@ben-crowhurst
Copy link
Member

    //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( );
    }
@ben-crowhurst ben-crowhurst modified the milestone: 1.0 May 6, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant