ScheduledUpdater Class |
Namespace: Microsoft.IoT.DeviceCore
The ScheduledUpdater type exposes the following members.
Name | Description | |
---|---|---|
ScheduledUpdater(ScheduleOptions) |
Initializes a new ScheduledUpdater using the default scheduler.
| |
ScheduledUpdater(ScheduleOptions, IScheduler) |
Initializes a new ScheduledUpdater instance.
|
Name | Description | |
---|---|---|
IsStarted |
Gets a value that indicates if the updater is currently providing updates.
| |
ScheduleOptions |
Gets the schedule options currently being used by the scheduler.
| |
Scheduler |
Gets the scheduler that is providing updates.
| |
StartWithEvents |
Gets or sets a value that indicates if Start will
get called when the first event is subscribed to.
| |
StopWithEvents |
Gets or sets a value that indicates if Stop will
get called when the last event is unsubscribed.
| |
UpdateInterval |
Gets or sets the update interval.
|
Name | Description | |
---|---|---|
Close | ||
Equals | (Inherited from Object.) | |
GetHashCode | (Inherited from Object.) | |
GetType | (Inherited from Object.) | |
SetAsyncUpdateAction |
Sets an asynchronous update action to be called by the scheduler.
| |
SetUpdateAction |
Sets a synchronous update action to be called by the scheduler.
| |
Start |
Starts executing updates with the scheduler.
| |
Stop |
Stops updates from being executed by the scheduler.
| |
ToString | (Inherited from Object.) |
Name | Description | |
---|---|---|
Started |
Occurs right after updates have been started with the scheduler.
| |
Starting |
Occurs right before updates are started with the scheduler.
| |
Stopped |
Occurs right after updates are stopped with the scheduler.
| |
Stopping |
Occurs right before updates are stopped with the scheduler.
|
ScheduledUpdater is capable of delivering both synchronous and asynchronous through the SetUpdateAction(ScheduledAction) and SetAsyncUpdateAction(ScheduledAsyncAction) methods respectively.
ScheduledUpdater is commonly used in device classes to schedule polling of device data. Devices that share the same IScheduler automatically share time slices on a CPU. Whenever a ScheduledUpdater is created using a constructor that doesn't explicitly receive an IScheduler instance, Default is automatically used.
Because ScheduledUpdater is commonly used by devices (especially sensors) there is a common need is to start updates when one or more device events are subscribed to then stop updates when the last subscription is removed. To help with this common scenario, ScheduledUpdater implements the IEventObserver interface which means it can be passed to the constructor of any ObservableEvent (included in the Microsoft.IoT.DeviceHelpers library).