WebThread

From Xojo Documentation

Class (inherits from Thread)

A Session-aware thread for use in web apps.

Events
Run UserInterfaceUpdate


Properties
DebugIdentifier StackSize ThreadState
Priority ThreadID fa-lock-32.png


Methods
AddUserInterfaceUpdate Resume Start
Pause Sleep Stop

Notes

Use of a WebThread prevents you from having to use WebSessionContext.

Allow the thread to go out of scope in order for the web framework to properly manage it. If you keep the thread alive (by having an infinite loop in its Run event handler), your sessions may not quit which could result in memory leaks.

Remember, threads stay in scope as long as they are active (running, sleeping, etc.)

fa-info-circle-32.png
The main reason to use a WebThread is that its session is retained. That means that if you do anything that would require manipulating the session, the framework can accurately figure out which session it belongs to. If you're doing something that is not session sensitive, you could use a regular Thread.

See Also

Session, Thread, WebSession, WebSessionContext