Skip to content

[Epic-Ideas-from-Alex] Threading-model rewrite: one dispatcher, cancellation everywhere, deterministic dispose #3446

Open

Description

🚀 Feature Request

Replace the ad-hoc mix of event handlers, TaskCompletionSources, SemaphoreSlim queues and sync-over-async with a single explicit model:

Example

using var cts = new CancellationTokenSource(TimeSpan.FromSeconds(10));
await page.GetByRole(AriaRole.Button, new() { Name = "Pay" }).ClickAsync(cancellationToken: cts.Token);

await foreach (var req in page.RequestsAsync(cts.Token)) { /* no lost events */ }

Motivation

Most recent correctness bugs in this repo are races or shutdown hangs, fixed one at a time. They are also the hardest to reproduce, and the most damaging in large parallel suites and on the Playwright Service.

A deliberate model, documented and stress-tested, removes the whole class instead of patching symptoms. It's also the foundation the other .NET-idiomatic features need (IAsyncEnumerable events, cancellation).

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions