Fibers<TSource, TValue> Class
- Namespace
- SatorImaging.UnityFundamentals
public class Fibers<TSource, TValue> : Fibers, IAsyncEnumerable<TValue>, IAsyncEnumerator<TValue>, IAsyncDisposable
Represents a concrete implementation of Fibers that processes items from a generator and yields results asynchronously.
Type Parameters
TSourceThe type of the source items processed by the fiber.
TValueThe type of the result value produced by each task.
- Inheritance
-
Fibers<TSource, TValue>
- Implements
-
IAsyncEnumerable<TValue>IAsyncEnumerator<TValue>
- Inherited Members
-
- Extension Methods
Constructors
- Fibers(int, IEnumerator<(TSource source, Func<TSource, Task<TValue>> factory)>)
Initializes a new instance of the Fibers<TSource, TValue> class.
Properties
- IsRunning
Gets a value indicating whether the fiber is actively processing tasks.
Methods
- Start()
Starts the execution of the fiber. If the fiber is already running, it returns the existing active task.
- Stop()
Stops the execution of the fiber and waits for currently running background tasks to complete.