Dex.Fiber

g Dex.Fiber Dex.Fiber Dex.Future Dex.Future Dex.Future->Dex.Fiber Dex.Object Dex.Object Dex.Object->Dex.Future

Subclasses:

None

Methods

Inherited:

Dex.Future (48), Dex.Object (2)

Virtual Methods

None

Fields

None

Class Details

class Dex.Fiber
Bases:

Dex.Future

Abstract:

No

Dex.Fiber is a fiber (or coroutine) which itself is a Dex.Future.

When the fiber completes execution it will either resolve or reject the with the result or error.

You may treat a Dex.Fiber like any other Dex.Future which makes it simple to integrate fibers into other processing chains.

Dex.Fiber are provided their own stack seperate from a threads main stack, They are automatically scheduled as necessary.

Use Dex.Future.await_() and similar functions to await the result of another future within the fiber and the fiber will be suspended allowing another fiber to run and/or the rest of the applications main loop.

Once a fiber is created, it is pinned to that scheduler. Use Dex.Scheduler.spawn() to create a fiber on a specific scheduler.