Class wwAsyncWebRequest

This class is an Aysnc Event manager that manages events placed into a table. Both client and server applications can look at this event management table to get their input, create their output and pass data between the client and server applications.

Methods exist to pass data into the even table by using special input fields or an easy to use property mechanism that can set and retrieve individual properties WITH a single command.

For a full article that describes the concepts behind Async requests and a more detailed example of how this class is built and implemented see:

http://www.west-wind.com/articles.asp

and view the Aysnc Web Request article.




Based on: Relation
Stored in: wwAsyncWebRequst.prg

Class Members

MemberDescription

CancelEvent

Cancels an event in the table by setting the Cancel flag on the oEven object/table.

o.CancelEvent(lcID)

CheckForCompletion

Function: Checks to see if an event has been completed
and simply returns a result value of the status.

o.CheckForCompletion( lcID )

Close

Closes the event table.

o.Close()

CompleteEvent

Closes out a pending event by setting it's completion timestamp. You can also pass a parameter that specifies the ReturnData to set for the client app.

o.CompleteEvent( lcID, lcData )

DeleteEvent

This method is not really required, but it physically deletes an event record. When events are completed they are not explicitly deleted, but rather the Completion timestamp is set. This method explicitly removes the event record.

o.DeleteEvent( lcId )

GetNextEvent

Retrieves a pending event from the event queue and sets the oEvent member with the retrieved event object.

o.GetNextEvent(lcType)

GetProperty

Retrieves a dynamic property set. Properties are stored in XML format in the Properties field of the Event record and can contain any simple data types of any size. For example you can store XML strings to be passed from the client app to the server app.

o.GetProperty(lcProperty)

LoadEvent

This method retrieves an event by its ID and loads the oEvent member. This method is called by all other methods that have EventId parameters.

o.LoadEvent(lcID)

Open

Low level method that opens and selects the event table. Used internally to get the table ready.

o.Open(lcFile, lcPath, lcAlias)

Reindex

Cleans out old timed out events and packs and reindexes the Event file.

o.Reindex()

SaveEvent

This method saves the current event stored in the oEvent member. This method is called by all other methods that write and updated events to disk.

o.SaveEvent()

SetProperty

Sets a dynamic property of any simple type.

o.SetProperty(lcProperty, lvValue)

SubmitEvent

Submits an event to the Event queue. You can pass input data and title for the event and optionally hold off saving the event to set additional properties manually.

o.SubmitEvent( lcInputData, lcTitle, llNoSave )

cAlias

The alias of the table.

cDataPath

The path where the Event table sits. Defaults to a blank path (ie. in the Fox path).

cErrorMsg

Error message if lError is true.

cFileName

The name of the events table. This filename should not include a path or extension.

lError

Error flag.

nDefaultExpire

Expire requests after x number of seconds after start. Used by the garbage collector for this object.

nSQLMode

Determines how events are stored.

oEvent

The oEvent record contains the actual event data.

Requirements

Assembly: wwAsyncWebRequest.prg

See also:

Class wwAsyncWebRequest | Class wwmsmq

© West Wind Technologies, 1996-2017 • Updated: 01/09/16
Comment or report problem with topic