Skip to content

Conversation

mayuki
Copy link
Member

@mayuki mayuki commented Aug 1, 2023

Adds experimental support for loop actions that can await asynchronous events.

With SynchronizationContext, all asynchronous continuations are executed on the loop thread.
Please beware that asynchronous actions are executed across multiple frames, unlike synchronous actions.

await looper.RegisterActionAsync(static async (ctx, state) =>
{
    state.Add("1"); // Frame: 1
    await Task.Delay(250);
    state.Add("2"); // Frame: 2 or later
    return false;
});

@mayuki mayuki merged commit 687b3e2 into master Aug 1, 2023
@mayuki mayuki deleted the feature/ExperimentalAsyncActionSupport branch August 1, 2023 09:47
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

Successfully merging this pull request may close these issues.

1 participant