Internet Direct (Indy)
Home
PreviousUpNext
TIdThread.Yarn Property

Represents the thread or fiber for the scheduler of the thread.

Pascal
property Yarn: TIdYarn;

Yarn is a TIdYarn property that represents the association between a thread or fiber and the client context used in scheduling a connection to a TCP server. 

TIdTCPServer introduces an abstract representation for executable tasks for client connections to a multi-threaded TCP server. This abstraction, called a Yarn, allows the use either threads or fibers for execution of client connections to the server. Each client connection, or Yarn, represents a task that is managed by the Scheduler for the server. 

There are basically two types of Schedulers available for TIdTCPServer: Thread-based and Fiber-based. Each is designed to work with a specific type of executable task (or Yarn) that represents the client connections. 

TIdScheduler specifies (and in some cases - implements) methods that handle creation, execution, and termination of tasks for client connections. Applications must use an instance of a descendant class (like TIdSchedulerOfThreadDefault, TIdSchedulerOfThreadPool, or TIdSchedulerOfFiber) that implements the mechanism for managing the TIdYarn for the executable task. 

The Yarn property in TIdThread is provided to store a reference to the mechanism used in scheduling the thread. TIdThread frees the reference in Yarn in its protected Execute method following a call to AfterRun in the thread execution model.

Internet Direct (Indy) version 10.1.5
Copyright © 1993-2006, Chad Z. Hower (aka Kudzu) and the Indy Pit Crew. All rights reserved.
Website http://www.indyproject.org.
Post feedback to the Indy Documentation newsgroup.