Skip to content

Commit 54fa273

Browse files
committed
Update Readme.
1 parent 559ea8c commit 54fa273

File tree

1 file changed

+11
-9
lines changed

1 file changed

+11
-9
lines changed

Readme.md

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -135,8 +135,8 @@ executionContext.Enqueue(action);
135135

136136
#### 3. Subscribe(...) ####
137137
```csharp
138-
driver1.Subscribe(async (ev) => {...});
139-
driver2.Subscribe(async () => {...});
138+
driver1.SubscribeAndReceiveAsTask(async (ev) => {...});
139+
driver2.SubscribeAndReceiveAsTask(async () => {...});
140140
```
141141

142142
#### 4. Subscribe(...) via AsyncRegister ####
@@ -154,8 +154,8 @@ while (...)
154154
- Create `PoolFiber`. Most basic method.
155155
- Create `ThreadPoolAdaptor`. Allows the main thread to be used like a thread pool.
156156
- 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.
159159

160160
### How to pause contexts ###
161161

@@ -172,21 +172,23 @@ Fiber is a mechanism for sequential processing. Actions added to a fiber are ex
172172
* _[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.
173173
* _[ThreadFiber](https://github.com/tosh-coding/AsyncFiberWorks/blob/main/src/AsyncFiberWorks/Fibers/ThreadFiber.cs)_ - This fiber generates and uses a dedicated thread internally.
174174
* _[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.
175176

176177
## ThreadPools ##
177178
* _[DefaultThreadPool](https://github.com/tosh-coding/AsyncFiberWorks/blob/main/src/AsyncFiberWorks/Threading/DefaultThreadPool.cs)_ - Default implementation that uses the .NET thread pool.
178179
* _[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.
179180
* _[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.
180181

181182
## 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.
183184

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).
187189

188190
## 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.
190192

191193
A channel is a messaging mechanism that abstracts the communication destination. Fibers act as actors. Arrival messages are processed in parallel for each fiber.
192194

0 commit comments

Comments
 (0)