[🚀 Feature]: [dotnet] [bidi] opt-in parallel event handler execution

Aperta
#18,301 3 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
45/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
csharp

Direzione di ricerca

Start by locating the .NET BiDi event subscription implementation and the IEventSource<T> and IBiDi interfaces named in the proposed API. Trace how subscriptions invoke handlers and drain work during disposal, then check the related subscription tests. Done means an opt-in concurrency setting or equivalent API is implemented with the stated ordering, failure propagation, and disposal behavior clarified and covered by tests.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

A-needs-triaging I-enhancement
Description

BiDi event handlers run serially per subscription: one worker awaits each handler before taking the next event. Good default (ordered, isolated, drains on dispose), but throughput is bounded by handler latency.

50 console.log events with a 100 ms handler take ~5 s; with 8 concurrent handlers ~0.7 s.

Users wanting concurrency today must fire-and-forget inside the handler (losing failure propagation and drain-on-dispose) or write a custom StreamAsync() consumer.

Have you considered any alternatives or workarounds?

Opt in to invoke handlers parallelizable.

Proposed API
public sealed class SubscribeOptions
{
    public int MaxConcurrency { get; set; } = 1;
}

// new overloads on IEventSource<T> (and IBiDi)
Task<ISubscription> SubscribeAsync(Func<T, Task> handler, SubscribeOptions options, CancellationToken ct = default);
Task<ISubscription> SubscribeAsync(Action<T> handler, SubscribeOptions options, CancellationToken ct = default);

Or something like chaining handlers:

source.WithParallel(8).SubscribeAsync(handler)
Lingua principale
Java
Stelle
34.6k
Fork
8.7k
Merge medio
1g 23h
PR unite (30g)
86

Preparare l'ambiente

Apri in Codespaces

Avvia il container di sviluppo del progetto nel browser, con il tuo account GitHub.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di SeleniumHQ/selenium

Tutte le issue di SeleniumHQ/selenium

Issue simili

Altre issue su Java

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.