Skip to content

WasmScheduler class

Defined in

Namespace: ReactiveUI.Primitives.Reactive.Concurrency Assembly: ReactiveUI.Primitives.Reactive.dll Full name: ReactiveUI.Primitives.Reactive.Concurrency.WasmScheduler Modifiers: public sealed

Summary

View source

Task-pool replacement for single-threaded event-loop runtimes such as browser WebAssembly: it never starts threads, never blocks, and does not support long-running scheduling. Immediate work is batched one drain per event-loop turn through a zero-due timer (a setTimeout(0) macrotask on WebAssembly, so the browser can render between batches); delayed and periodic work use one-shot/periodic timers, which the WebAssembly runtime backs with the JS event loop. Successor to the retired Reactive.Wasm package's scheduler, whose runtime reflection no longer exists on modern .NET.

Applies to

net10.0, net10.0-android36.0, net10.0-ios26.0, net10.0-macos26.0, net10.0-tvos26.0, net10.0-maccatalyst26.0, net10.0-browserwasm1.0, net10.0-desktop1.0, net9.0, net9.0-desktop1.0, net9.0-browserwasm1.0, net8.0, net8.0-ios17.5, net8.0-maccatalyst17.5, net8.0-macos14.2, net8.0-macos14.5, net8.0-tvos17.2, netstandard2.1, net481, net471, net462

Class hierarchy
classDiagram
class WasmScheduler
class LocalScheduler
LocalScheduler <|-- WasmScheduler
class ISchedulerPeriodic {
    <>
}
ISchedulerPeriodic <|.. WasmScheduler
class IDisposable {
    <>
}
IDisposable <|.. WasmScheduler

Inherits from: LocalScheduler

Implements: ISchedulerPeriodic, IDisposable

Properties

NameSummary
static DefaultGets the shared WebAssembly scheduler.

Methods

NameSummary
ScheduleSchedules an action to be executed on the next event-loop turn.
SchedulePeriodicSchedules a periodic action. Periods below one millisecond (including zero) are clamped to one millisecond: a tight sequential loop would starve a single-threaded event loop, and browsers clamp...
DisposeDisposes the drain timer owned by this scheduler.
Inherited members