Fiber
Fibers Lighweight Cooperative Multitasking
Askowl.Fiber.Worker< T > Class Template Referenceabstract

Worker with payload More...

Inheritance diagram for Askowl.Fiber.Worker< T >:
Askowl.Fiber.Worker

Public Member Functions

virtual void Step ()
 Implement on processing worker (usually calls dispose) More...
 
override string ToString ()
 Return worker name More...
 
virtual void Dispose ()
 Move Fiber back to queue it came from More...
 
Fiber Load (Fiber fiber, T data)
 Load happens when we are building up a list of actions More...
 

Public Attributes

virtual bool NoMore => false
 Implement to stop scanning based on sort order More...
 
string Name
 Name from worker class name More...
 
Seed
 Payload More...
 

Protected Member Functions

virtual int CompareTo (Worker other)
 Implement for worker queue order More...
 
abstract bool Prepare ()
 Do any preparation to payload here More...
 
abstract void Recycle ()
 Implement anything needed before worker is placed in recycle bin More...
 
void ActivateWorker (Fiber fiber)
 Move fiber to worker queue and start processing More...
 

Static Protected Member Functions

static void Deactivate (LinkedList< Fiber >.Node node)
 
static int Compare (LinkedList< Fiber >.Node left, LinkedList< Fiber >.Node right)
 

Protected Attributes

Fiber Fiber
 Fiber that owns this worker instance More...
 

Static Protected Attributes

static int Uid
 
static bool NeedsUpdates = true
 Set to false for workers that do not need calls on frame update More...
 

Detailed Description

Worker with payload

Definition at line 56 of file Worker.cs.

Member Function Documentation

◆ ActivateWorker()

void Askowl.Fiber.Worker< T >.ActivateWorker ( Fiber  fiber)
protected

◆ CompareTo()

virtual int Askowl.Fiber.Worker< T >.CompareTo ( Worker< T >  other)
protectedvirtual

◆ Dispose()

virtual void Askowl.Fiber.Worker< T >.Dispose ( )
virtual

Move Fiber back to queue it came from

Definition at line 48 of file Worker.cs.

◆ Load()

Fiber Askowl.Fiber.Worker< T >.Load ( Fiber  fiber,
data 
)

◆ Prepare()

abstract bool Askowl.Fiber.Worker< T >.Prepare ( )
protectedpure virtual

◆ Recycle()

abstract void Askowl.Fiber.Worker< T >.Recycle ( )
protectedpure virtual

◆ Step()

virtual void Askowl.Fiber.Worker< T >.Step ( )
virtual

◆ ToString()

override string Askowl.Fiber.Worker< T >.ToString ( )

Member Data Documentation

◆ Fiber

◆ Name

string Askowl.Fiber.Worker< T >.Name

Name from worker class name

Definition at line 36 of file Worker.cs.

◆ NeedsUpdates

bool Askowl.Fiber.Worker< T >.NeedsUpdates = true
staticprotected

◆ NoMore

virtual bool Askowl.Fiber.Worker< T >.NoMore => false

◆ Seed

T Askowl.Fiber.Worker< T >.Seed

Payload

Definition at line 58 of file Worker.cs.


The documentation for this class was generated from the following file: