Color scheme: Light
You are here: start » en » Documentation » Microsoft Access development tools » WKL Forms Object Library » WKL Forms Object Library API reference » WklTimerList

WklTimerList

WklTimerList class

Signature

Dim myWklTimerList As WklTimerList
Set myWklTimerList = Me!ControlName.Object

Summary

Scheduled tasks of a form: a delayed search, a counter refreshed periodically, a paced queue of web requests. Visible in Design view, invisible in Form view.

Parameters

None

Remarks

Events are posted and delivered after the running event procedure of the control has ended, never from inside another of its events. The tasks end when the form closes; no event arrives afterwards. See the overview for the scheduling rules.

An ActiveX control: inserted into a form in design view (Form Design › Controls › ActiveX Controls); reports are not supported. VBA reaches it through the Object property of the control, where ControlName is the name of the control on the form.

MemberKindSummary
`Tasks`PropertyGets the tasks of the list.
`Start`MethodStarts all enabled tasks.
`Stop`MethodStops all tasks.
`Pause`MethodPauses all waiting tasks; the time left is kept.
`Resume`MethodResumes all paused tasks and every web request queue halted by an answer 401.
`AutoStart`PropertyGets or sets whether all tasks start when the form opens in Form view.
`Running`PropertyGets the number of runs going on.
`MaxParallel`PropertyGets or sets how many background jobs may run at the same time.
EventSummary
`TaskDue`Occurs when a run of a wttEvent task is due; the event procedure is the run.
`TaskStarted`Occurs when a background run sends its first web request.
`TaskProgress`Occurs when a background job reports progress.
`TaskCompleted`Occurs when a background run ended successfully; for a web request queue, when the queue became empty.
`TaskFailed`Occurs when a background run failed.
`TaskCancelled`Occurs when a background run was canceled.
`RequestCompleted`Occurs when a web request was answered with a status 2xx or 3xx.
`RequestFailed`Occurs when a web request was answered with another status, or not at all.
`RequestCancelled`Occurs when a web request was canceled.
`QueuePaused`Occurs when an answer 429 paused the whole queue.
`QueueHalted`Occurs when an answer 401 halted the whole queue.
`QueueResumed`Occurs when a pause ended or Resume was called.

Code example

None

Inheritance

None

Tasks property

Signature

Property Get Tasks() As WklTimerTasks

Summary

Gets the tasks of the list.

Parameters

None

Property value: `WklTimerTasks` – The collection of tasks.

Remarks

Read-only.

Code example

None

Inheritance

Declared by WklTimerList.

Start method

Signature

Sub Start()

Summary

Starts all enabled tasks.

Parameters

None

Remarks

In Design view nothing runs; the tasks start in Form view.

Code example

None

Inheritance

Declared by WklTimerList.

Stop method

Signature

Sub Stop()

Summary

Stops all tasks.

Parameters

None

Remarks

A running VBA event and a web request on the way end normally and are reported; nothing more is scheduled.

Code example

None

Inheritance

Declared by WklTimerList.

Pause method

Signature

Sub Pause()

Summary

Pauses all waiting tasks; the time left is kept.

Parameters

None

Remarks

None

Code example

None

Inheritance

Declared by WklTimerList.

Resume method

Signature

Sub Resume()

Summary

Resumes all paused tasks and every web request queue halted by an answer 401.

Parameters

None

Remarks

None

Code example

None

Inheritance

Declared by WklTimerList.

AutoStart property

Signature

Property Get AutoStart() As Boolean
Property Let AutoStart(RHS As Boolean)

Summary

Gets or sets whether all tasks start when the form opens in Form view.

Parameters

None

Property value: Boolean – True: start with the form; False (default): start by code.

Remarks

Read/write.

Code example

None

Inheritance

Declared by WklTimerList.

Running property

Signature

Property Get Running() As Long

Summary

Gets the number of runs going on.

Parameters

None

Property value: Long – The number of runs handed out and not yet ended.

Remarks

Read-only.

Code example

None

Inheritance

Declared by WklTimerList.

MaxParallel property

Signature

Property Get MaxParallel() As Long
Property Let MaxParallel(RHS As Long)

Summary

Gets or sets how many background jobs may run at the same time.

Parameters

None

Property value: Long – At least 1 (default 1).

Remarks

Reserved for the file, checksum, ZIP and program kinds. Each web request queue sends one request at a time; several queues run side by side.

Read/write.

Code example

None

Inheritance

Declared by WklTimerList.

TaskDue event

Signature

Event TaskDue(ByVal Key As String, ByVal RunId As Long, ByVal Tag As Variant, ByRef Cancel As Integer)

Summary

Occurs when a run of a wttEvent task is due; the event procedure is the run.

Parameters

NameTypeOptionalDefaultDescription
KeyStringNo–The key of the task.
RunIdLongNo–The number of the run.
TagVariantNo–The Tag of the task.
CancelInteger (by reference)No–Set to True to skip the run.

Remarks

Set Cancel to True to skip this run; an interval series goes on. A web request queue raises TaskStarted instead.

In a form module: Private Sub <ControlName>_TaskDue(...). Parameters passed by reference can be changed by the procedure.

Code example

None

Inheritance

Declared by WklTimerList.

TaskStarted event

Signature

Event TaskStarted(ByVal Key As String, ByVal RunId As Long)

Summary

Occurs when a background run sends its first web request.

Parameters

NameTypeOptionalDefaultDescription
KeyStringNo–The key of the task.
RunIdLongNo–The number of the run.

Remarks

In a form module: Private Sub <ControlName>_TaskStarted(...). Parameters passed by reference can be changed by the procedure.

Code example

None

Inheritance

Declared by WklTimerList.

TaskProgress event

Signature

Event TaskProgress(ByVal Key As String, ByVal RunId As Long, ByVal Percent As Long, ByVal Text As String)

Summary

Occurs when a background job reports progress.

Parameters

NameTypeOptionalDefaultDescription
KeyStringNo–The key of the task.
RunIdLongNo–The number of the run.
PercentLongNo–0 to 100.
TextStringNo–A short description of the step.

Remarks

Raised by the file, checksum, ZIP and program kinds, which are not available in this version.

In a form module: Private Sub <ControlName>_TaskProgress(...). Parameters passed by reference can be changed by the procedure.

Code example

None

Inheritance

Declared by WklTimerList.

TaskCompleted event

Signature

Event TaskCompleted(ByVal Key As String, ByVal RunId As Long, ByVal Result As Variant)

Summary

Occurs when a background run ended successfully; for a web request queue, when the queue became empty.

Parameters

NameTypeOptionalDefaultDescription
KeyStringNo–The key of the task.
RunIdLongNo–The number of the run.
ResultVariantNo–For a web request queue Array(completed, failed): the numbers of requests completed and failed for good in this run.

Remarks

A wttEvent run raises no TaskCompleted: its run is TaskDue.

In a form module: Private Sub <ControlName>_TaskCompleted(...). Parameters passed by reference can be changed by the procedure.

Code example

None

Inheritance

Declared by WklTimerList.

TaskFailed event

Signature

Event TaskFailed(ByVal Key As String, ByVal RunId As Long, ByVal Number As Long, ByVal Description As String, ByVal WillRetry As Boolean)

Summary

Occurs when a background run failed.

Parameters

NameTypeOptionalDefaultDescription
KeyStringNo–The key of the task.
RunIdLongNo–The number of the run.
NumberLongNo–The error number.
DescriptionStringNo–The error text.
WillRetryBooleanNo–True when the run is repeated after RetryDelay.

Remarks

Raised by the file, checksum, ZIP and program kinds; a web request reports RequestFailed.

In a form module: Private Sub <ControlName>_TaskFailed(...). Parameters passed by reference can be changed by the procedure.

Code example

None

Inheritance

Declared by WklTimerList.

TaskCancelled event

Signature

Event TaskCancelled(ByVal Key As String, ByVal RunId As Long, ByVal Reason As WklTimerCancelReason)

Summary

Occurs when a background run was canceled.

Parameters

NameTypeOptionalDefaultDescription
KeyStringNo–The key of the task.
RunIdLongNo–The number of the run.
Reason`WklTimerCancelReason`No–Why: wcrCancel, wcrStop, wcrTimeout or wcrClose.

Remarks

In a form module: Private Sub <ControlName>_TaskCancelled(...). Parameters passed by reference can be changed by the procedure.

Code example

None

Inheritance

Declared by WklTimerList.

RequestCompleted event

Signature

Event RequestCompleted(ByVal Key As String, ByVal Id As Long, ByVal Tag As Variant, ByVal Status As Long, ByRef Result As WklHttpResult)

Summary

Occurs when a web request was answered with a status 2xx or 3xx.

Parameters

NameTypeOptionalDefaultDescription
KeyStringNo–The key of the task.
IdLongNo–The Id of the request.
TagVariantNo–The Tag of the request.
StatusLongNo–The HTTP status.
Result`WklHttpResult` (by reference)No–The answer: Text, Status, Header(Name), Headers.

Remarks

Further requests may be added to the queue here, for example the requests that need the key returned in the answer.

In a form module: Private Sub <ControlName>_RequestCompleted(...). Parameters passed by reference can be changed by the procedure.

Code example

None

Inheritance

Declared by WklTimerList.

RequestFailed event

Signature

Event RequestFailed(ByVal Key As String, ByVal Id As Long, ByVal Tag As Variant, ByVal Status As Long, ByVal Description As String, ByVal WillRetry As Boolean, ByRef Result As WklHttpResult)

Summary

Occurs when a web request was answered with another status, or not at all.

Parameters

NameTypeOptionalDefaultDescription
KeyStringNo–The key of the task.
IdLongNo–The Id of the request.
TagVariantNo–The Tag of the request.
StatusLongNo–The HTTP status; 0 when no answer came.
DescriptionStringNo–Method, address without query, and status or cause; never a header value or a body.
WillRetryBooleanNo–True when the request is sent again.
Result`WklHttpResult` (by reference)No–The answer when one came (for example a problem+json message), otherwise Nothing.

Remarks

Only a request without answer and an answer 429 are sent again; any other answer, also 5xx, is reported as it is, because a repetition could do the work twice. A second 401 in a row for the same request is reported here, and the queue halts again.

In a form module: Private Sub <ControlName>_RequestFailed(...). Parameters passed by reference can be changed by the procedure.

Code example

None

Inheritance

Declared by WklTimerList.

RequestCancelled event

Signature

Event RequestCancelled(ByVal Key As String, ByVal Id As Long, ByVal Tag As Variant, ByVal Reason As WklTimerCancelReason)

Summary

Occurs when a web request was canceled.

Parameters

NameTypeOptionalDefaultDescription
KeyStringNo–The key of the task.
IdLongNo–The Id of the request.
TagVariantNo–The Tag of the request.
Reason`WklTimerCancelReason`No–Why: wcrCancel, wcrStop, wcrTimeout or wcrClose.

Remarks

A request whose connection was closed may have changed data at the service; its outcome is unknown.

In a form module: Private Sub <ControlName>_RequestCancelled(...). Parameters passed by reference can be changed by the procedure.

Code example

None

Inheritance

Declared by WklTimerList.

QueuePaused event

Signature

Event QueuePaused(ByVal Key As String, ByVal Reason As String, ByVal ResumeAt As Date)

Summary

Occurs when an answer 429 paused the whole queue.

Parameters

NameTypeOptionalDefaultDescription
KeyStringNo–The key of the task.
ReasonStringNo–The cause, “429”.
ResumeAtDateNo–The local time the queue goes on.

Remarks

The pause is the time in Retry-After (seconds or an HTTP date); without it, RateWindow, or 60 seconds.

In a form module: Private Sub <ControlName>_QueuePaused(...). Parameters passed by reference can be changed by the procedure.

Code example

None

Inheritance

Declared by WklTimerList.

QueueHalted event

Signature

Event QueueHalted(ByVal Key As String, ByVal Id As Long, ByVal Status As Long, ByVal Headers As String)

Summary

Occurs when an answer 401 halted the whole queue.

Parameters

NameTypeOptionalDefaultDescription
KeyStringNo–The key of the task.
IdLongNo–The Id of the halted request.
StatusLongNo–The HTTP status.
HeadersStringNo–The response headers as text, one per line.

Remarks

Sign in again on the main thread, set the shared headers and call Resume: the halted request is sent first.

In a form module: Private Sub <ControlName>_QueueHalted(...). Parameters passed by reference can be changed by the procedure.

Code example

None

Inheritance

Declared by WklTimerList.

QueueResumed event

Signature

Event QueueResumed(ByVal Key As String)

Summary

Occurs when a pause ended or Resume was called.

Parameters

NameTypeOptionalDefaultDescription
KeyStringNo–The key of the task.

Remarks

In a form module: Private Sub <ControlName>_QueueResumed(...). Parameters passed by reference can be changed by the procedure.

Code example

None

Inheritance

Declared by WklTimerList.

en/wiki/msaccess/comctl/api-reference/wkltimerlist.txt · Last modified: by Wolfgang van der Stille