Class CallbackScheduler
Sensus schedules operations via a scheduler.
Inheritance
System.Object
CallbackScheduler
Assembly: SensusAndroid.dll
Syntax
public abstract class CallbackScheduler : Object
Constructors
CallbackScheduler()
Declaration
public CallbackScheduler()
Fields
SENSUS_CALLBACK_INVOCATION_ID_KEY
Declaration
public const string SENSUS_CALLBACK_INVOCATION_ID_KEY = "SENSUS-CALLBACK-INVOCATION-ID"
Field Value
Type |
Description |
System.String |
|
SENSUS_CALLBACK_KEY
Declaration
public const string SENSUS_CALLBACK_KEY = "SENSUS-CALLBACK"
Field Value
Type |
Description |
System.String |
|
Methods
CancelLocalInvocation(ScheduledCallback)
Declaration
protected abstract void CancelLocalInvocation(ScheduledCallback callback)
Parameters
CancelRaisedCallback(ScheduledCallback)
Cancels a callback that has been raised and is currently executing.
Declaration
public void CancelRaisedCallback(ScheduledCallback callback)
Parameters
ContainsCallback(ScheduledCallback)
Declaration
public bool ContainsCallback(ScheduledCallback callback)
Parameters
Returns
Type |
Description |
System.Boolean |
|
RaiseCallbackAsync(ScheduledCallback, String)
Raises a ScheduledCallback. This involves initiating the ScheduledCallback, setting up cancellation timing
for the callback's action based on the Timeout, and scheduling the next invocation of the
ScheduledCallback in the case of repeating ScheduledCallbacks. See CancelRaisedCallback(ScheduledCallback)
for how to cancel a ScheduledCallback after it has been raised. Unlike other methods called via the app's entry points
(e.g., push notifications, alarms, etc.), this method does not take a System.Threading.CancellationToken. The reason for this is that
raising ScheduledCallbacks is done from several locations, and cancellation is only needed due to background considerations
on iOS. So we've centralized background-sensitive cancellation into the iOS override of this method.
Declaration
public virtual Task RaiseCallbackAsync(ScheduledCallback callback, string invocationId)
Parameters
Type |
Name |
Description |
ScheduledCallback |
callback |
Callback to raise.
|
System.String |
invocationId |
Identifier of invocation.
|
Returns
Type |
Description |
System.Threading.Tasks.Task |
Async task
|
RaiseCallbackAsync(String, String)
Declaration
public Task RaiseCallbackAsync(string callbackId, string invocationId)
Parameters
Type |
Name |
Description |
System.String |
callbackId |
Callback identifier.
|
System.String |
invocationId |
Invocation identifier.
|
Returns
Type |
Description |
System.Threading.Tasks.Task |
Task.
|
RaiseCallbacksAsync(Regex)
Declaration
public Task RaiseCallbacksAsync(Regex idPattern)
Parameters
Type |
Name |
Description |
System.Text.RegularExpressions.Regex |
idPattern |
Identifier pattern.
|
Returns
Type |
Description |
System.Threading.Tasks.Task |
Task.
|
RequestLocalInvocationAsync(ScheduledCallback)
Declaration
protected abstract Task RequestLocalInvocationAsync(ScheduledCallback callback)
Parameters
Returns
Type |
Description |
System.Threading.Tasks.Task |
|
ScheduleCallbackAsync(ScheduledCallback)
Declaration
public Task<ScheduledCallbackState> ScheduleCallbackAsync(ScheduledCallback callback)
Parameters
Returns
TestHealth()
Declaration
TryGetCallback(String)
Declaration
protected ScheduledCallback TryGetCallback(string id)
Parameters
Type |
Name |
Description |
System.String |
id |
|
Returns
UnscheduleCallbackAsync(ScheduledCallback)
Unschedules the callback, first cancelling any executions that are currently running and then removing the callback from the scheduler.
Declaration
public Task UnscheduleCallbackAsync(ScheduledCallback callback)
Parameters
Returns
Type |
Description |
System.Threading.Tasks.Task |
|
UnscheduleCallbackAsync(String)
Unschedules the callback.
Declaration
public Task UnscheduleCallbackAsync(string id)
Parameters
Type |
Name |
Description |
System.String |
id |
Identifier.
|
Returns
Type |
Description |
System.Threading.Tasks.Task |
Task.
|
UnscheduleCallbacksAsync(Regex)
Declaration
public Task UnscheduleCallbacksAsync(Regex idPattern)
Parameters
Type |
Name |
Description |
System.Text.RegularExpressions.Regex |
idPattern |
Identifier pattern.
|
Returns
Type |
Description |
System.Threading.Tasks.Task |
Task.
|