You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -306,9 +306,11 @@ While capturing component references use a similar syntax to [capturing element
306
306
307
307
## Invoke component methods externally to update state
308
308
309
-
Blazor uses a `SynchronizationContext` to enforce a single logical thread of execution. A component's [lifecycle methods](xref:blazor/lifecycle) and any event callbacks that are raised by Blazor are executed on this `SynchronizationContext`. In the event a component must be updated based on an external event, such as a timer or other notifications, use the `InvokeAsync` method, which will dispatch to Blazor's `SynchronizationContext`.
309
+
Blazor uses a synchronization context (`SynchronizationContext`) to enforce a single logical thread of execution. A component's [lifecycle methods](xref:blazor/lifecycle) and any event callbacks that are raised by Blazor are executed on the synchronization context.
310
310
311
-
For example, consider a *notifier service* that can notify any listening component of the updated state:
311
+
Blazor Server's synchronization context attempts to emulate a single-threaded environment so that it closely matches the WebAssembly model in the browser, which is single threaded. At any given point in time, work is performed on exactly one thread, giving the impression of a single logical thread. No two operations execute concurrently.
312
+
313
+
In the event a component must be updated based on an external event, such as a timer or other notifications, use the `InvokeAsync` method, which will dispatch to Blazor's synchronization context. For example, consider a *notifier service* that can notify any listening component of the updated state:
312
314
313
315
```csharp
314
316
publicclassNotifierService
@@ -373,7 +375,7 @@ Use the `NotifierService` to update a component:
373
375
}
374
376
```
375
377
376
-
In the preceding example, `NotifierService` invokes the component's `OnNotify` method outside of Blazor's `SynchronizationContext`. `InvokeAsync` is used to switch to the correct context and queue a render.
378
+
In the preceding example, `NotifierService` invokes the component's `OnNotify` method outside of Blazor's synchronization context. `InvokeAsync` is used to switch to the correct context and queue a render.
377
379
378
380
## Use \@key to control the preservation of elements and components
0 commit comments