You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- Create `ThreadPoolAdaptor`. Allows the main thread to be used like a thread pool.
156
156
- Create `UserThreadPool`. Suitable for handling blocking processes.
157
-
- Create `AsyncActionDriver` and use it with a repeating timer, which works well with tick-based game loop implementations.
158
-
- Create `AsyncActionDriver<T>` and use it for event distribution.
157
+
- Create `ActionDriver` and use it with a repeating timer, which works well with tick-based game loop implementations.
158
+
- Create `AsyncMessageDriver<T>` and use it for event distribution.
159
159
160
160
### How to pause contexts ###
161
161
@@ -172,21 +172,23 @@ Fiber is a mechanism for sequential processing. Actions added to a fiber are ex
172
172
*_[PoolFiber](https://github.com/tosh-coding/AsyncFiberWorks/blob/main/src/AsyncFiberWorks/Fibers/PoolFiber.cs)_ - The most commonly used fiber. Internally, the [.NET thread pool is used](https://github.com/tosh-coding/AsyncFiberWorks/blob/main/src/AsyncFiberWorks/Core/DefaultThreadPool.cs#L21) by default, and a user thread pool is also available.
173
173
*_[ThreadFiber](https://github.com/tosh-coding/AsyncFiberWorks/blob/main/src/AsyncFiberWorks/Fibers/ThreadFiber.cs)_ - This fiber generates and uses a dedicated thread internally.
174
174
*_[StubFiber](https://github.com/tosh-coding/AsyncFiberWorks/blob/main/src/AsyncFiberWorks/Fibers/StubFiber.cs)_ - Fiber without consumer thread. Buffered actions are not performed automatically and must be pumped manually.
175
+
*_[AsyncFiber]()_ - Fiber implementation built with asynchronous control flow. It's operating thread is unstable.
175
176
176
177
## ThreadPools ##
177
178
*_[DefaultThreadPool](https://github.com/tosh-coding/AsyncFiberWorks/blob/main/src/AsyncFiberWorks/Threading/DefaultThreadPool.cs)_ - Default implementation that uses the .NET thread pool.
178
179
*_[UserThreadPool](https://github.com/tosh-coding/AsyncFiberWorks/blob/main/src/AsyncFiberWorks/Threading/UserThreadPool.cs)_ - Another thread pool implementation, using the Thread class to create a thread pool. If you need to use blocking functions, you should use the user thread pool. This does not disturb the .NET ThreadPool.
179
180
*_[ThreadPoolAdaptor](https://github.com/tosh-coding/AsyncFiberWorks/blob/main/src/AsyncFiberWorks/Threading/ThreadPoolAdaptor.cs)_ - A thread pool that uses a single existing thread as a worker thread. Convenient to combine with the main thread.
180
181
181
182
## Drivers ##
182
-
Drivers provide the timing of execution. It provides methods for invoking and subscribing to actions. Execution is done serially.
183
+
Drivers call their own Subscriber handlers. There are two types: timing notification and message delivery. They are processed in series.
183
184
184
-
*_[ActionDriver](https://github.com/tosh-coding/AsyncFiberWorks/blob/main/src/AsyncFiberWorks/Procedures/ActionDriver.cs)_ - Execute registered actions in bulk. [Example](https://github.com/tosh-coding/AsyncFiberWorks/blob/main/src/AsyncFiberWorksTests/ActionDriverTests.cs#L13).
185
-
*_[AsyncActionDriver](https://github.com/tosh-coding/AsyncFiberWorks/blob/main/src/AsyncFiberWorks/Procedures/AsyncActionDriver.cs)_ - Executes registered asynchronous tasks in bulk. [Example](https://github.com/tosh-coding/AsyncFiberWorks/blob/main/src/AsyncFiberWorksTests/ActionDriverTests.cs#L39).
186
-
*_[AsyncActionDriver{T}](https://github.com/tosh-coding/AsyncFiberWorks/blob/main/src/AsyncFiberWorks/Procedures/AsyncActionDriverOfT.cs)_ - Executes registered asynchronous tasks in bulk. Arguments can be specified. [Example1](https://github.com/tosh-coding/AsyncFiberWorks/blob/main/src/AsyncFiberWorksTests/ActionDriverTests.cs#L67). [Example2](https://github.com/tosh-coding/AsyncFiberWorks/blob/main/src/AsyncFiberWorksTests/AsyncActionDriverWithProcessedFlagEventArgsTests.cs).
185
+
*_[ActionDriver](https://github.com/tosh-coding/AsyncFiberWorks/blob/main/src/AsyncFiberWorks/Procedures/ActionDriver.cs)_ - Calls the subscriber's handler. It runs on one fiber. [Example](https://github.com/tosh-coding/AsyncFiberWorks/blob/main/src/AsyncFiberWorksTests/ActionDriverTests.cs).
186
+
*_[AsyncMessageDriver{TMessage}](https://github.com/tosh-coding/AsyncFiberWorks/blob/main/src/AsyncFiberWorks/MessageDrivers/AsyncMessageDriver.cs)_ - It distributes messages to subscribers. [Example](https://github.com/tosh-coding/AsyncFiberWorks/blob/main/src/AsyncFiberWorksTests/ActionDriverTests.cs#L68).
187
+
*_[AsyncProcessedFlagMessageDriver{TMessage}](https://github.com/tosh-coding/AsyncFiberWorks/blob/main/src/AsyncFiberWorks/MessageDrivers/AsyncProcessedFlagMessageDriver.cs)_ - It distributes messages to subscribers. [Example](https://github.com/tosh-coding/AsyncFiberWorks/blob/main/src/AsyncFiberWorksTests/AsyncActionDriverWithProcessedFlagEventArgsTests.cs#L16).
188
+
*_[AsyncProcessedFlagReverseOrderMessageDriver{TMessage}](https://github.com/tosh-coding/AsyncFiberWorks/blob/main/src/AsyncFiberWorks/MessageDrivers/AsyncProcessedFlagReverseOrderMessageDriver.cs)_ - It distributes messages to subscribers. [Example](https://github.com/tosh-coding/AsyncFiberWorks/blob/main/src/AsyncFiberWorksTests/AsyncActionDriverWithProcessedFlagEventArgsTests.cs#L50).
187
189
188
190
## Channels ##
189
-
This is a mechanism for parallel processing. If you do not need that much performance, `AsyncActionDriver{T}` is recommended because it is easier to handle.
191
+
This is a mechanism for parallel processing. If you do not need that much performance, `AsyncMessageDriver{T}` is recommended. It is easy to handle because it is serial.
190
192
191
193
A channel is a messaging mechanism that abstracts the communication destination. Fibers act as actors. Arrival messages are processed in parallel for each fiber.
0 commit comments