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

Event queue library. #2

Open
Thecarisma opened this issue Jun 26, 2020 · 0 comments
Open

Event queue library. #2

Thecarisma opened this issue Jun 26, 2020 · 0 comments

Comments

@Thecarisma
Copy link
Member

The library should be able to execute events (invoke a function) at a later time sequentially, randomly, and/or asynchronously. There can be a limit to how many events is executed at once or can be randomized.

Sample api.

#include <exotic/libeventq.h>

void count_to_million()
{

}
void change_background()
{

}

int main()
{
    EventQ *event_queue; 
    init_eventq(&event_queue);

    push_event(MAIN_THREAD, count_to_million);
    push_event(GUI_THREAD, change_background);

    destroy_eventq(event_queue);
}

Also, functions should be able to time out if it taking longer than the specified time to finish execution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant